Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC to Access
Message
De
24/12/2003 14:04:30
 
 
À
22/12/2003 13:09:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00861351
Message ID:
00861977
Vues:
20
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform