Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error with CA x ADO x SQL Server
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Error with CA x ADO x SQL Server
Miscellaneous
Thread ID:
00945695
Message ID:
00945695
Views:
55
VFP and ADO do not execute scope_identity() in SQL SERVER 2000.



My code :
PUBLIC oFa  as CursorAdapter 

oFa = CREATEOBJECT('_ca_familia')   && my CA classe save conection object in _screen.__sqlconexao property
oFa.CursorFill()
 = CURSORSETPROP("Buffering",5,"familia")

INSERT INTO familia (cd_familia,ds_familia) values([0001],[teste])
llRet = TABLEUPDATE(.T.,.T.,"familia")

IF llRet
   LOCAL oRs AS 'ADODB.RecordSet'
   LOCAL lnRet

   oRs = CREATEOBJECT('ADODB.RecordSet')
   oRs.CursorLocation = 2  && adUseServer
   oRs.CursorType = 0  && adOpenForwardOnly
   oRs.LockType = 1  && adLockReadOnly
   oRs.Open("SELECT scope_identity() AS 'id'",_screen.__sqlconexao )
   lnRet = oRs.Fields(0).value    && Return NULL.
   oRs.Close() 
   oRs = NULL

ENDIF
TIA
Paulo Cesar Carneiro
desenvolvimento@controplan.com.br


"My God, what have we done?"
-- Capt. Robert Lewis, co-pilot of the Enola Gay, recalling the moment the atomic bomb exploded over Hiroshima

At 8:15 a.m. on August 6 1945
Next
Reply
Map
View

Click here to load this message in the networking platform