Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a client side recordset from an ADO command object
Message
From
29/11/2000 11:18:27
Jorge Haro
Independent Consultant
Juarez, Mexico
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Returning a client side recordset from an ADO command object
Miscellaneous
Thread ID:
00446804
Message ID:
00446804
Views:
43
It can be done right?, I'm getting server side recordsets regrdless of how I set up the recordset, it's an SQL Server 6.5 stored procedure btw, let me know if you need to see the stored procedure's code, this is the VFP code:
#include adovfp.h

clear

public oConnection, oCommand, oRecordSet

oConnection = CreateObject("adodb.connection")
oCommand = CreateObject("adodb.command")

oConnection.Open("SVEIN","sa","")

With oCommand
   	.ActiveConnection = oConnection
   	.CommandText = "ITEMSPERCLASS"
	.CommandType = adCmdText
EndWith

oClassParameter = oCommand.CreateParameter( "@pnClassID" , adInteger , adParamInput , 4 , 45 )

oClassParameter = CreateObject("adodb.parameter")

With oClassParameter
   .Name = "@pnClassID"
   .Type = adInteger
   .Direction = adParamInput
   .Value = 45
EndWith

oCommand.Parameters.Append(oClassParameter)

With oClassParameter
   .Value = 45
EndWith

oRecordSet = createobject("adodb.recordset")

with oRecordSet

   	.CursorLocation = adUseClient
   	.LockType = adLockBatchOptimistic
	.CursorType = adOpenStatic

EndWith

oRecordset = oCommand.Execute

?oRecordSet.RecordCount && Prints -1 
?oRecordSet.CursorLocation && Prints 2, ADUSESERVER
TIA
Next
Reply
Map
View

Click here to load this message in the networking platform