Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC vs OLE DB; how to connect to SQL Server with OLE DB
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00853430
Message ID:
00853463
Vues:
17
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform