Page 1 of 1

ADO : doesn't work anymore

Posted: Sun Nov 06, 2016 9:23 am
by Franklin Demont
Hello ,

I used to work with ADO (mdb-files) , till last month no problems.

Since then i can't changed data in a mdb-file , i.e.
(see also http://forums.fivetechsupport.com/viewt ... =3&t=33115)

Code: Select all

oRs                 := TOleAuto():New( "ADODB.Recordset" )
oRs:CursorType      := 1        // opendkeyset
oRs:CursorLocation  := 3        // local cache
oRs:LockType        := 3        // lockoptimistic
               
try
   oRs:Open( "SELECT * FROM " + cTable, oCon ) // Password="abc" )
catch oError
   MsgInfo( oError:Description )
end
?  oRs:CursorType , oRs:CursorLocation , oRs:LockType  // 3,3,3 !!!!!
// Is it normal that cursortype is changed in 3 ?  

DBG oRs  // Shows correct

oRs:MoveFirst()
oRs:Fields("ROW2"):Value := "Test"
oRs:Update()   <= ERROR , due to previous line
 


Error description: (DOS Error -2147352567) WINOLE/1007 Kan de bij te werken rij niet vinden. Sommige waarden zijn mogelijk veranderd sinds de rij voor het laatst is gelezen. (0x80040E38): Microsoft Cursor Engine

(Can not fint row to work on. Some values can be changed after the row was read)


Also when i try to use older versions from fivedbu i get this error. The most recent doesn't generate a error but doesn't changed the data

I suppose something has changed in the environnement , but i have no idea to restore it.

Is there a key in regedit ? Maybe a download ?

Frank

Re: ADO : doesn't work anymore

Posted: Sun Nov 06, 2016 9:07 pm
by Rick Lipkin
Franklin

see this post :

http://forums.fivetechsupport.com/viewt ... 2&start=15

Rick Lipkin

Re: ADO : doesn't work anymore

Posted: Mon Nov 07, 2016 12:49 am
by nageswaragunupudi
? oRs:CursorType , oRs:CursorLocation , oRs:LockType // 3,3,3 !!!!!
// Is it normal that cursortype is changed in 3 ?
Always and at all times, a client side record-set is opened with cursor-type adOpenStatic only, whatever cursortype we specify while opening the recordset. In other words, it is just useless and meaningless for us to specify a cursor type while openining a recordset with cursorlocation adUseClient.

This has been the behavior since ADO was created. There is nothing surprising or unusual about it.

Again, it is not that ADO was made like that. It is because with all RDBMSs, all client side cursors are static cursors.

Exceptions are (1) ADS and (2) one table at a time per one connection of MSSQL.