Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create Connection Issue
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00567062
Message ID:
00567161
Vues:
15
This message has been marked as the solution to the initial question of the thread.
>I tried the code you pointed me to with this code:
>
>
>open database data\webfiles
>
>#define ODBC_ADD_DSN 1
>#define ODBC_CONFIG_DSN 2
>#define ODBC_REMOVE_DSN 3
>#define ODBC_ADD_SYS_DSN 4
>#define ODBC_CONFIG_SYS_DSN 5
>#define ODBC_REMOVE_SYS_DSN 6
>#define ODBC_REMOVE_DEFAULT_DSN 7
>#define SQL_NO_DATA 100
>#define SQL_SUCCESS_WITH_INFO 1
>#define SQL_SUCCESS 0
>#define SQL_ERROR -1
>
>
>DECLARE Integer SQLConfigDataSource IN odbccp32.dll Integer, Short, String @, String @
>
>lc_driver = "{Microsoft Access Driver (*.mdb)}" + CHR(0)
>lc_dsn = "dsn=bulletin" + CHR(0) + ;
> "server =g:\developt\webserver\public\bulletins\bulletin.mdb" + CHR(0) + ;
> "database=webfiles"
>
>fResult = SQLConfigDataSource(0, ODBC_ADD_DSN, @lc_driver, @lc_dsn)
>
>wait wind str(fresult)
>
>use bulletin
>brow
>
>**********
>
>the fresult returned "0" which seems to fit
>
>but I crash when I try to use the view bulletin with the message
>"data source name not found and no default driver specified"
>
>Is the value for lc_driver wrong??
>
>Sandy

The attributes in lc_dsn are wrong. That's what I was referring to about the Access settings. Change your lc_dsn to this and it should work:
lc_dsn = "dsn=bulletin" + CHR(0) + ;
"UID=Admin" + Chr(0) +;
"PWD=" + Chr(0) +;
"DBQ=g:\developt\webserver\public\bulletins\bulletin.mdb" + CHR(0)
HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform