Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC Connection from Excel to VFP
Message
De
14/09/1998 01:22:17
Jim Underwood
Apollo Information Systems, Inc.
Houston, Texas, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
ODBC Connection from Excel to VFP
Divers
Thread ID:
00136022
Message ID:
00136022
Vues:
71
Anyone know the correct syntax for establishing an ODBCDirect connection from Excel97 to VFP6 DBC?

Here's what I've tried that didn't work:

=======================================================
Dim wrkODBC As Workspace
Dim conVFP As Connection


' Create ODBCDirect Workspace object.
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", _
"admin", "", dbUseODBC)

*** HERE'S THE MSFT EXAMPLE FROM EXCEL VBA HELP ***

' Set conPubs = wrkODBC.OpenConnection("Connection1", _
' dbDriverNoPrompt, , _
' "ODBC;DATABASE=pubs;UID=sa;PWD=;DSN=Publishers")

*** HERE'S MY SETUP ***

Set conVFP = wrkODBC.OpenConnection("VFPTest", _
dbDriverNoPrompt, , _
"ODBC;DATABASE=TestData;UID=;PWD=;DSN=E:\Projects\Test\Data\TestData;")

*** BY SETTING OPTIONS TO dbDriverPrompt I was able to establish a connection to the above DNS. From the VBA "Watches" window, I copied the "connect" string shown below: ***

Set conVFP = wrkODBC.OpenConnection("VFP1", _
dbDriverNoPrompt, , _
"ODBC;Driver={Microsoft Visual FoxPro Driver};" _
& "UID=;PWD=;SourceDB=E:\Projects\Test\data\TESTDATA.DBC;" _
& "SourceType=DBC;Exclusive=No;" _
& "BackgroundFetch=Yes;Collate=Machine;")


========================================================

This didn't work either. The only error msg I get is "ODBC Failed. Check your spelling..."

Any Ideas?

TIA,
jmu
Best Regards,

Jim Underwood
Apollo Information Systems, Inc.
Houston, TX
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform