Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Working with ADO
Message
From
17/10/2001 14:53:18
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00569691
Message ID:
00569839
Views:
26
Bharat,
Did you #INCLUDE ADO.H or define adOpenKeySet and adLockOptimistic? These are constants that you need to define in VFP:
#DEFINE ADOPENKEYSET           1
#DEFINE ADLOCKPESSIMISTIC      2
#DEFINE ADLOCKOPTIMISTIC       3
*etc.
My guess is that without specifying LockTypeEnum, you get a read-only cursor. Try changing the open command as follows:
oRecordset.open("select * from _4_CLAIM_DBF_TEMP", oConnection, ADOPENKEYSET, ADLOCKOPTIMISTIC)
oRecordset.Delete() && should work now
Alternatively, you should be able to delete all records with the following command:
oRecordset.open("DELETE FROM < Your Table >", oConnection)
HTH
>Thanks Daniel and Thomas,
>
>Yes it creates the connection but while creating the recordset it says " Variable adopenkeyset not found" and if i remove Adopenketset and again test it than it says "variable adLockOptimistic not found.".
> It does work like
>if I use like
>
>Public oConnection as Object
>Public oRecordset As Object
>
>oConnection = createobject("adodb.connection")
>oConnection.Open("Provider=MSDASQL;SERVER=HDS_SQLSERVER1;DATABASE=Pubs;DRIVER={SQL SERVER};uid=sa;pwd=sa")
>oRecordset = CreateObject("adodb.recordset")
>oRecordset.open("select * from _4_CLAIM_DBF_TEMP", oConnection, 1)
>Actually I want to delete all the rows from the table "_4_CLAIM_DBF_TEMP" and insert data from FoxPro.
>
>so the command
>for xCOUNT = 1 to NCOUNT
> oRecordset.delete
> oRecordset.movenext
>endfor
>
>This gives me error at oRecordset.delete saying
>"OLEIDispatch Exception code 0 from ADODB Recordset:
>Object or provider is not capable of performing requested operation"
>
>If instead I try this
>
>oRecordset."delete from _4_CLAIM_DBF_TEMP"
>I get the error message
>"Unrecoganised command verb."
>
>Thanks
>Bharat
Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform