Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC connection my first attempt
Message
 
À
09/08/2016 16:59:05
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2008 R2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01639227
Message ID:
01639286
Vues:
55
>>My first attempts are with errors of course. I am using the IP address for the server as directed by the admin providing the remote SQL server. he sent me examples with Access as the front end. I get an error then i get an alternate server login box. No luck with either of those, but I'll keep plugging along; any advice appreciated. Thanks.
>>
>>(by the way, I was able to get the DSN method to work for me) but not your recommended method.
>
>The error message indicates that the credentials from your machine are not valid in the domain on which server resides. By default, however, it will try to use them. Add this clause: trusted_connection=no to force it to use SQL server authentication and not the Windows authentication (which failed).
>
>>
>>
>>gc_sqlserver = ALLTRIM("10.0.0.107")
>>gc_sqluser = ALLTRIM("NC.plant")
>>gc_sqlpassword = ALLTRIM("The@r0|ina&."
>>gc_database = ALLTRIM("ECNC Interface")
>>
>>
>>
>>*-- Connect to SQL Server
>>SET MESSAGE TO "connecting"
>>lcConnString ="Driver=SQL Server;Server=" + gc_sqlserver + ";Database=" + gc_database
>>lcConnstring = lcConnstring + ";UID =" + gc_sqluser + ";PWD =" + gc_sqlpassword 
>>
>>gnsqlHandle = SQLStringConnect(lcConnString)
>>if gnsqlHandle < 1
>>	? "you have a connection problem"
>>endif
>>
I would also make sure that the DSN connection itself works - I think there is a 'test connection' button when you set that up. What I've done in the past is also make a new connection in my DBC - you can also test that to see if it works.
ICQ 10556 (ya), 254117
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform