Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble with ADO 2.7 Recordset
Message
From
02/05/2002 09:26:43
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00651650
Message ID:
00651798
Views:
16
>I'm trying to open a recordset with no records.
>
>
>loConnection = CREATEOBJECT('ADODB.Connection')
>* Set properties
>loConnection.open()
>
>loCommand = CREATEOBJECT('ADODB.Command')
>loCommand.ActiveConnection = loConnection
>loCommand.CommandType = 1
>loCommand.CommandText = 'Select * from (sometable)'
>
>loRecordSet = CREATEOBJECT('ADODB.RecordSet')
>loRecordSet.CursorType 	= ADOPENDYNAMIC
>loRecordSet.LockType 	= ADLOCKOPTIMISTIC
>loRecordSet.ActiveConnection 	= loConnection
>loRecordSet.CursorLocation 	= ADUSECLIENT
>
>loRecordSet(Open,,,,ADEXECUTENORECORDS)
>
>
>I keep getting the following error :
>
>OLE IDispatch exception code 0 from ADODB.Recordset :
>Arguments are of the wrong type, are out of acceptable
>range, or are in conflict with one another...
>
>
>
>Any help would be appreciated,
>Jake

Instead use a SQL statement that does not return records, something like the following:
loRecordSet(Open,"Select * From myTable Where 1=0")
HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform