Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter with SQL and parameter
Message
From
22/09/2004 15:01:43
 
 
To
22/09/2004 10:02:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00944961
Message ID:
00945168
Views:
30
Hi Cetin and Doug,

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