Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC vs OLE DB; how to connect to SQL Server with OLE DB
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00853430
Message ID:
00853463
Views:
16
>To connect to SQL SERVER 2000, do I still need to use ODBC or can I use OLE DB? & if OLE DB is the recommended driver, how do I convert my VFP 7 application programs from using ODBC to OLE DB?

Inge,

You can use either. VFP's SQLCONNECT() and SQLSTRINGCONNECT() assume you are connecting via ODBC. For OLEDB, you would have to make use of the ADO classes (e.g. Connection, RecordSet, Command, etc). To just initiate a connection in ADO, instantiate the ADODB.Connection class and call the Open method passing it the connection string:
oConn = NEWOBJECT("ADODB.Connection")
oConn.Open("<yourconnectionstring>")
Check out http://www.able-consulting.com/ADO_Conn.htm for examples on what connection strings to use.

Laterness,
Jon
Jon Rosenbaum
Devcon Drummer
Previous
Reply
Map
View

Click here to load this message in the networking platform