Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO Recordsets and CursorLocation Property
Message
From
13/09/1999 12:39:34
Bob Tracy
Independent Consultant
Driftwood, Texas, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00263979
Message ID:
00264055
Views:
24
Hi Pete,
I don't know if this will help but here's one I use for something similar:

* datacontrol.GetECOsForPart
LPARAMETERS tcPart,tcDate
LOCAL lcSQL
oConn = CREATE('ADODB.Connection')
WITH oConn
.ConnectionString = 'File Name=ECC.UDL'
.Open
ENDWITH
THIS.oRSList = CREATE('ADODB.RecordSet')
WITH THIS.oRSList
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockReadOnly
ENDWITH
oCommand = CREATE('ADODB.Command')
WITH oCommand
.CommandText = 'sp_getecosforpart_date'
.CommandType = adCmdStoredProc
.Parameters.Append(oCommand.CreateParameter("@part",adChar,,16,tcPart))
.Parameters.Append(oCommand.CreateParameter("@date",adChar,,10,tcDate))
.ActiveConnection = oConn
ENDWITH
THIS.oRSList.Open(oCommand)

HTH
>Hello Gang,
>does anyone know a way to create a Client Side ADO recordset from a ADO Command object containing one or more Parameter objects, I can do it by creating the empty RecordSet object and setting the properties before the Open method is called, but I need to create a RecordSet with the Command object, here is what I've done so far
>
>Form method: SetupConnection
>
>with this
> if .ConnectionEstablished
> return .t.
> endif
> .oConnection = create('ADODB.Connection')
> .oConnection.Open(.ConnectionString) && Set in the Init
> .oCommand = create('adodb.Command')
> .oCommand.ActiveConnection = .oConnection
> .oCommand.CommandText = .cSQLString && Set in the Init
> .oParameter_Batch_No = .oCommand.CreateParameter('batch_no',ADINTEGER,ADPARAMINPUT,2,.batch_no)
> .oCommand.Parameters.Append(.oParameter_Batch_No)
> .ConnectionEstablished = .t.
>endwith
>
>I then issue: .oRecordset = .oCommand.Execute(), which creates the RecordSet ok but it's server side. Apart from closing and reopening the RecordSet, I can't think of another way to set the location, any ideas gratefuly received
>
>Regards
>
>
>Pete Kane
Bob Tracy

Never engage in a battle of wits if you're only half armed.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform