Vb6 row cannot be located for updating

Posted by / 06-Sep-2020 07:12

Vb6 row cannot be located for updating

You should make a point ofexplicitly naming the columns in your select clause so that1) you only retrieve the data you need, and2) you don't force ADO to generate metadata, which sometimes requires anextra trip to the database??? particularly the first chapter(chapter 11, I think)Here is the link again. If yournewsreader is breaking the line, you will need to reassemble the link: would be my preference, except that you must have had some reasonto choose an expensive keyset cursor ...are you keeping the recordsetopen long enough to cause concerns about concurrency? Update method I get the error -2147217864 (Row cannot belocated for updating.The table it tries to update has an Identity column. Post by fniles I am using VB6 connecting to a SQL Server 2005 database using ADO. Some values may have been changedsince it was last read).The "Programming ADO" book talks about clientside cursor, I use ad Use Clientcursor Location for the connection, and I did not set/change the cursorlocation for the recordset. Update method somebody else already updateeither Status, Price,or Location column. If I understand it correctly, does it mean that I can trap this error andthen resubmit the same query and then do update again ?Say the previous value are the following: Status = 0, Price = 2000, Location= 'TX'Is it correct that on the query above, the ADO Cursor Engine builds a querylike Update my Table SET Status = 1, Price = 2500, Location = 'IL' where [Order] ='D100-12345' and Status = 0 and Price = 2000 and Location = 'TX' ? Recordsets, whileinefficient for updating data, do provide good functionality for handlingconcurrency issues. Please post small, compact test case not using any of your specifics. Hi doing some tests I could see, that there is a different behavior depending on the testcase. read a record and update the record immediately = OK 2. Update() 'Error show up her End With End Sub End Module works as expected with both drivers on: - remote My SQL server 5.0.68pb-win32 - My ODBC 3.51.26 & 5.1.5 pre-release mysql select * from bug38147; ------- ------ ------ ------ ------ ------ ------ ------ ------ ----------- | Fld1 | Fld2 | Fld3 | Fld4 | Fld5 | Fld6 | Fld7 | Fld8 | Fld9 | totalconc | ------- ------ ------ ------ ------ ------ ------ ------ ------ ----------- | Primo | 2 | 3 | 4 | NULL | 6 | NULL | NULL | 9 | 12.5000 | ------- ------ ------ ------ ------ ------ ------ ------ ------ ----------- 1 row in set (0.00 sec) Change DSN to 3.51.26, update value back: mysql select * from bug38147; ------- ------ ------ ------ ------ ------ ------ ------ ------ ----------- | Fld1 | Fld2 | Fld3 | Fld4 | Fld5 | Fld6 | Fld7 | Fld8 | Fld9 | totalconc | ------- ------ ------ ------ ------ ------ ------ ------ ------ ----------- | Primo | 2 | 3 | 4 | NULL | 6 | NULL | NULL | 9 | 10.1000 | ------- ------ ------ ------ ------ ------ ------ ------ ------ ----------- 1 row in set (0.00 sec) mysql Server log: 080718 28 Query CREATE TABLE `bug38147` ( `Fld1` varchar(9) NOT NULL, `Fld2` smallint(5) DEFAULT NULL, `Fld3` tinyint(3) unsigned DEFAULT NULL, `Fld4` smallint(5) DEFAULT NULL, `Fld5` datetime DEFAULT NULL, `Fld6` varchar(10) DEFAULT NULL, `Fld7` datetime DEFAULT NULL, `Fld8` datetime DEFAULT NULL, `Fld9` varchar(7) DEFAULT NULL, `totalconc` decimal(19,4) DEFAULT NULL, PRIMARY KEY (`Fld1`) ) ENGINE=Inno DB DEFAULT CHARSET=latin1 28 Query insert into bug38147 values ("Primo", 2,3,4, NULL,"6", NULL, NULL,10.10) 080718 28 Query insert into bug38147 values ("Primo",2,3,4, NULL,"6", NULL, NULL,"9",10.10) 080718 29 Connect [email protected] on test 29 Query SET NAMES utf8 29 Query SET character_set_results = NULL 29 Query select database() 29 Query select database() 29 Query SELECT @@tx_isolation 29 Query SELECT * FROM bug38147 WHERE Fld1 = 'Primo' 29 Query UPDATE `test`.`bug38147` SET `totalconc`=12.5000 WHERE `Fld1`=_latin1'Primo' AND `totalconc`=10.1000 080718 29 Quit 080718 28 Query select * from bug38147 080718 30 Connect [email protected] on test 30 Query select database() 30 Query select database() 30 Query SELECT @@tx_isolation 30 Query SELECT * FROM bug38147 WHERE Fld1 = 'Primo' 30 Query UPDATE `test`.`bug38147` SET `totalconc`='10.1000' WHERE `Fld1`='Primo' AND `totalconc`='12.5000' 30 Quit 080718 28 Query select * from bug38147 Now, your logs are *unusable*! Another point; both of your logs show *successful* updates (yes yes, I took a look at 2x100000 lines...) but done via parameters which is not in accordance to your test case.

You will get aquicker response by posting to the newsgroup. I have changed the query to explicitly naming the columns in the selectclause. The error that I got is causeed because in between executing the query"select [Order], Status, Price, Location from my Table where [order] = '" &(s Order) & "' and calling the .

I am using Lock Typead Lock Optimistic and cursor Type ad Open Keyset. The table it tries to update has an Identity column. This is usually due to a lack of a primary key on the table.

I am using Lock Type ad Lock Optimistic and cursor Type ad Open Keyset. If your tabledoes have a primary key, the problem can also be caused by not including theprimary key field(s) in the select clause of the query used to open therecordset.

The sql statement include all columns:select * from my Table where [order] = '" & (s Order) & "'What chapter and section from David Sceppa's "Programming ADO" bookthat talks about it ? Updatemy Err: NR = 0Do While err.number = -2147217864 And NR Post by fniles I am using VB6 connecting to a SQL Server 2005 database using ADO. Some values may have been changedsince it was last read).

The table it tries to update has an Identity column. This is usually due to a lack of a primary key on the table.

vb6 row cannot be located for updating-12vb6 row cannot be located for updating-73vb6 row cannot be located for updating-18

Update 'Error show up her End With and the Table structure is CREATE TABLE `proyecto` ( `codproy` varchar(9) NOT NULL, `cont` smallint(5) DEFAULT NULL, `nsubgrupo` tinyint(3) unsigned DEFAULT NULL, `titulo` varchar(255) DEFAULT NULL, `tipo_actividad` varchar(25) DEFAULT NULL, `subtipo_actividad` varchar(35) DEFAULT NULL, `entidad_financ` varchar(12) DEFAULT NULL, `organismo` smallint(5) DEFAULT NULL, `fentrada` datetime DEFAULT NULL, `comite` varchar(10) DEFAULT NULL, `finicio` datetime DEFAULT NULL, `ffin` datetime DEFAULT NULL, `area` varchar(7) DEFAULT NULL, `fenvioetico` datetime DEFAULT NULL, `faprobetico` datetime DEFAULT NULL, `faprobcient` datetime DEFAULT NULL, `fconcesionfirma` datetime DEFAULT NULL, `registro` varchar(60) DEFAULT NULL, `estado` varchar(1) DEFAULT NULL, `totalconc` decimal(19,4) DEFAULT NULL, `bloqueo` varchar(1) DEFAULT NULL, PRIMARY KEY (`codproy`) ) ENGINE=Inno DB DEFAULT CHARSET=latin1; the exception aper with any table but this is and example Hi German and thanks for your report. Now, my test shows that simple case like: Module Module1 Sub Main() Dim con Dim SQL1 Dim rs Proyecto con = New ADODB. Open("DSN=51") SQL1 = "SELECT * FROM bug38147 WHERE Fld1 = 'Primo'" rs Proyecto = New ADODB. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".