Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC to Access
Message
From
24/12/2003 14:04:30
 
 
To
22/12/2003 13:09:27
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00861351
Message ID:
00861977
Views:
21
>I am trying to open an Access mdb in VFP using ODBC.
>
>The mdb is password-protected and uses some OCX for security.
>
>Here is the shortcut that successfully opens the mdb from the desktop. Without the OCX portion, access is denied.
>
>"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" "C:\somepath\somedata.mdb" /wrkgrp "C:\somepath
>\SSwsp32.ocx" /user "username" /pwd "password"
>
>QUESTION:
>How can I include this OCX parameter in the ODBC definition so that VFP can open Acces tables as remote views ?
>
>Note: An alternative to the command line is to change a registry setting to use the OCX. Is there a way to do it at the ODBC level ?

Hi Henry;
*--> build connection string
lcConnectionStr = "DRIVER={Microsoft Access Driver (*.mdb)};" +;
                  "Dbq=C:\somepath\somedata.mdb;" +;
                  "Uid=username;" +;
                  "Pwd=password;"

*--> connect to Access database
lnAccess = SQLSTRINGCONNECT(lcConnectionStr)

*--> add a record to the customers table
?SQLEXEC(lnAccess, "INSERT INTO customers (customerId, companyName) VALUES('X0001', 'Customer added through VFP')")
HTH

Merry Christmas!!

Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Reply
Map
View

Click here to load this message in the networking platform