|
Prev: URGENT RESPOND
Next: ODBC C API question(s)
From: "Jonathan Trahair" on 20 Mar 2007 14:53 ------=_NextPart_000_00C6_01C76B28.E82BD8C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Everyone I am using VB6 and MySQL, recently installed. I have a FlexGrid of = items. I save them, and in a large order (25 or more) there will be at = least one which causes an error "Row cannot be located for updating. = Some values may have been changed since it was last read." The values = looked up have not changed, the only change might be price or quantity. = I tried looking the order items up on their unique record number = (primary key), then I tried on their order number, item name and colour = (a unique set of values). It's always the same item(s) in a given order, = but for different orders it will not be the same item, colour or row = number as other orders. I've been onto Google and found some stuff about Option=3D2 but that = didn't make any difference. Can anyone shed light on this dark area? Thanks in advance. Jonathan Trahair ------=_NextPart_000_00C6_01C76B28.E82BD8C0--
From: Venu Anuganti on 20 Mar 2007 14:59 Jonathan It will be nice if you give the following details; so that it could to identify the reason for the error. 1. Table definition which caused the issue (show create table) 2. Code snippet of your vb code; so that it explains what kind of cursor and other options were used. Thanks Jonathan Trahair wrote: > Hi Everyone > > I am using VB6 and MySQL, recently installed. I have a FlexGrid of items. I save them, and in a large order (25 or more) there will be at least one which causes an error "Row cannot be located for updating. Some values may have been changed since it was last read." The values looked up have not changed, the only change might be price or quantity. I tried looking the order items up on their unique record number (primary key), then I tried on their order number, item name and colour (a unique set of values). It's always the same item(s) in a given order, but for different orders it will not be the same item, colour or row number as other orders. > > I've been onto Google and found some stuff about Option=2 but that didn't make any difference. > > Can anyone shed light on this dark area? > > Thanks in advance. > > Jonathan Trahair -- MySQL ODBC Mailing List For list archives: http://lists.mysql.com/myodbc To unsubscribe: http://lists.mysql.com/myodbc?unsub=myodbc(a)freebsd.csie.nctu.edu.tw
From: Daniel Kasak on 22 Mar 2007 17:41 Jonathan Trahair wrote: > Hi Everyone > > I am using VB6 and MySQL, recently installed. I have a FlexGrid of items. I save them, and in a large order (25 or more) there will be at least one which causes an error "Row cannot be located for updating. Some values may have been changed since it was last read." The values looked up have not changed, the only change might be price or quantity. I tried looking the order items up on their unique record number (primary key), then I tried on their order number, item name and colour (a unique set of values). It's always the same item(s) in a given order, but for different orders it will not be the same item, colour or row number as other orders. > > I've been onto Google and found some stuff about Option=2 but that didn't make any difference. > > Can anyone shed light on this dark area? > Basically don't use recordsets for updating. Maybe the v5 driver will do this properly, but I've never really had much success with the v3.51.x driver. Use a read-only recordset for fetching from the database, and any changes to the recordset you should send back as 'update table' commands. Sad but true. It's not hard to write some functions which automate this. Also as Venu pointed out, it's hard to give more specific answers, and possibly point out things you're doing wrong, if you don't actually give us any details of what you're doing. -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: dkasak(a)nusconsulting.com.au website: http://www.nusconsulting.com.au -- MySQL ODBC Mailing List For list archives: http://lists.mysql.com/myodbc To unsubscribe: http://lists.mysql.com/myodbc?unsub=myodbc(a)freebsd.csie.nctu.edu.tw
From: "Bonnett, John" on 22 Mar 2007 19:10 I have to agree completely with Daniel. I find a very simple way of working with MySQL (and any other SQL database for that matter) is to do all your input from the database using a read only recordset and all your output using INSERT, UPDATE and DELETE queries. These facilities are nearly always available and when errors occur, it is easy to identify and fix the problem because it will either be in your own code or in the SQL you wrote. When you use all the infrastructure of things like ADODB or ADO.NET etc. problems can be much harder to find, you are also buying into a lot of stuff you may not need and it may not work with the database you want to use. I am in the process of converting a MySQL database application that uses this approach from VB6 to VB.NET and it seems to be going rather well. I used VBMySQLDirect in VB6 and have switched to just using MySqlDataReader and action queries on the VB.NET side. This same app also needs to access SQL Server databases for some of its data. For that I can use SqlDataReader and action queries. At this level SQL Server and MySQL are very similar and I can write a wrapper class over both of them to hide the different data sources from the rest of the program. Although you need to write more code using this approach, it is all in your control and problems are easier to resolve because you van actually see what is going on. ______________ Carl Zeiss Vision Computer Scientist Asia Pacific John Bonnett 19 Cooroora Crescent Lonsdale SA 5160 Australia Phone: +61 (0) 8 8392 8366 Fax: +61 (0) 8 8392 8400 Email: john.bonnett(a)vision.zeiss.com Web: www.vision.zeiss.com This email, including any attachments, is intended for the sole use of the intended recipient(s) and may contain=20 information that is confidential, privileged and/or the sender's work. Any review or distribution by any other person is=20 prohibited. If you are not an intended recipient, please immediately contact the sender and delete all copies. -----Original Message----- From: Daniel Kasak [mailto:dkasak(a)nusconsulting.com.au]=20 Sent: Friday, 23 March 2007 8:17 AM To: Jonathan Trahair; myodbc(a)lists.mysql.com Subject: Re: Error message "Row cannot be located for updating" Jonathan Trahair wrote: > Hi Everyone > > I am using VB6 and MySQL, recently installed. I have a FlexGrid of items. I save them, and in a large order (25 or more) there will be at least one which causes an error "Row cannot be located for updating. Some values may have been changed since it was last read." The values looked up have not changed, the only change might be price or quantity. I tried looking the order items up on their unique record number (primary key), then I tried on their order number, item name and colour (a unique set of values). It's always the same item(s) in a given order, but for different orders it will not be the same item, colour or row number as other orders. > > I've been onto Google and found some stuff about Option=3D2 but that didn't make any difference. > > Can anyone shed light on this dark area? > =20 Basically don't use recordsets for updating. Maybe the v5 driver will do this properly, but I've never really had much success with the v3.51.x driver. Use a read-only recordset for fetching from the database, and any changes to the recordset you should send back as 'update table'=20 commands. Sad but true. It's not hard to write some functions which automate this. Also as Venu pointed out, it's hard to give more specific answers, and possibly point out things you're doing wrong, if you don't actually give us any details of what you're doing. -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: dkasak(a)nusconsulting.com.au website: http://www.nusconsulting.com.au -- MySQL ODBC Mailing List For list archives: http://lists.mysql.com/myodbc To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dmyodbc(a)freebsd.csie.nctu.edu.tw
|
Pages: 1 Prev: URGENT RESPOND Next: ODBC C API question(s) |