Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter with SQL and parameter
Message
From
29/12/2004 03:41:36
 
 
To
22/09/2004 15:01:43
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00944961
Message ID:
00972837
Views:
23
Hi Aleksey,

Did you also find that this doesn't work in VFP9?
Or is there a new better way of doing.

Sorry For Bringing up an old thread I just came across it in looking for a solution to my problem..

TIA
Tim

>There is an easier way to pass parameters using CursorAdapter, it handles parameters similar to SPT.
>
>
>CLOSE DATABASES ALL
>CLEAR
>
>customerid='ALFKI'
>
>LOCAL oCA as CursorAdapter
>
>oCA=CREATEOBJECT("CursorAdapter")
>oCA.SelectCmd="select * from Northwind..Orders where customerID = ?m.customerid"
>
>?"ODBC"
>oCA.DataSourceType="ODBC"
>oCA.DataSource=SQLCONNECT("localServer")
>
>IF oCA.DataSource<1
>	?"Failed to connect."
>ELSE
>	?oCA.CursorFill()
>	LIST
>	USE
>	SQLDISCONNECT(oCA.DataSource)
>ENDIF
>
>?
>?"ADO"
>
>LOCAL oConn as ADODB.Connection, oRS as ADODB.Recordset, oCom as ADODB.Command
>
>oConn=CREATEOBJECT("ADODB.Connection")
>oConn.Open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=(local)")
>
>oRS = CREATEOBJECT("Adodb.RecordSet")
>oRS.ActiveConnection = oConn
>
>oCom = CREATEOBJECT("Adodb.Command")
>oCom.ActiveConnection = oConn
>
>oCA.DataSourceType="ADO"
>oCA.DataSource=oRS
>
>?oCA.CursorFill(,,,oCom)
>LIST
>USE
>
>
>Thanks,
>Aleksey.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform