Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC Connection from Excel to VFP
Message
From
14/09/1998 01:22:17
Jim Underwood
Apollo Information Systems, Inc.
Houston, Texas, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
ODBC Connection from Excel to VFP
Miscellaneous
Thread ID:
00136022
Message ID:
00136022
Views:
72
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
Next
Reply
Map
View

Click here to load this message in the networking platform