Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MySQL Connect Problem
Message
De
24/11/2014 06:17:44
 
 
À
24/11/2014 06:07:34
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 Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01611335
Message ID:
01611340
Vues:
69
This message has been marked as a message which has helped to the initial question of the thread.
>>>>>Hi All
>>>>>
>>>>>Having a bit of a blind moment. I am trying to connect to a MySQL database that a contract programmer has given me without much documentation. Here is my test connection code:
>>>>>
>>>>>
>>>>>lcServer   = "localhost"
>>>>>lcDatabase = "MyTableName"
>>>>>lcUser     = "root"
>>>>>lcPassword = "MyPassword"
>>>>>
>>>>>lcStringConn  ="Driver={MySQL ODBC 3.51 Driver};Port=3306" + ;
>>>>>              ";Server="   + lcServer   + ;
>>>>>              ";Database=" + lcDatabase + ;
>>>>>              ";Uid="      + lcUser     + ;
>>>>>              ";Pwd="      + lcPassWord
>>>>>              
>>>>>lnHandle=SQLSTRINGCONNECT(lcStringConn)
>>>>>
>>>>>
>>>>>But I get a connection error which says: "Connectivity error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
>>>>>
>>>>>The contract developer says my connection string is right but clearly I cant connect. Where am I missing the obvious?
>>>>>
>>>>>TIA
>>>>
>>>>
>>>>Looks, OK - but you do specify the name of the database and not just a tablename, don't you ?
>>>
>>>Hi Gregory, sorry, in my example "MyTableName" should have been "MyDatabaseName". Sorry. I feel I am missing something obvious but cant think of it right now!
>>
>>
>>Maybe a 32/64 bit issue
>>
>>Try run C:\Windows\system32\odbcad32.exe and define a user DSN and see whether you can connect
>
>I ran odbcad32.exe and tried to create a user DSN but again it fails with "Connection failed. ... Cant connect 'localhost' (10061)"
>
> I looked under drivers and see 2 MySQL drivers as follows:
>
>MySQL ODBC 5.3 ANSI Driver
>MySQL ODBC 5.3 Unicode Driver
>
>If I change my connect string to reflect the first one I still get the same failure.
>
>This is a Windows 2008 R2 64 bit server.

(1) your connectionstring seems to be missing a semicolon after lcPassword
(2) see whether you have the 3.5 drivers under 64 bit odbc
(3) try to connect (set up a dsn) via 64 bit odbc

The connection string for 5.3 is different http://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration-connection-without-dsn.html
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform