Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Cetin Basoz
 To: joe Degorio
  Where is joe Degorio?
 Tacloban City
 joe Degorio
Subject: RE: ODBC Connector driver (64bit)
Thread ID: 395445 Message ID: 395715 # Views: 55 # Ratings: 0
Version: Visual FoxPro 9 Category: ODBC, ADO and OLEDB
Date: Friday, January 17, 2014 1:50:56 PM         

> Hello everyone,
> I have an application running on windows 7 (32bit). Now I'm trying to install it to a windows 7 64bit machine. I download the driver and configure it.. and have the following result.
> But when running the following code in vfp...
> PUBLIC h,lcStringConn,lcSQLScript1
> lcServer="localhost"
> lcDatabase="pharmacy"
> lcUser = "root"
> lcPassword = ""
> lcStringConn="Driver={MySQL ODBC 5.2 Unicode Driver};Port=3306"+;
>              ";Server="+lcServer+;
>              ";Database="+lcDatabase+;
>              ";Uid="+lcUser+;
>              ";Pwd="+lcPassWord
> *** Don't prompt for login
> SQLSETPROP(0,"DispLogin",3)
> h = SQLSTRINGCONNECT(lcStringConn)
> IF h > 0
>   WAIT WINDOW "System v0.1 is now Connected!" nowait
> *   =AERROR(laError)
>    MESSAGEBOX("Error at Connecting"+chr(13)+"Please contact the Administrator to fix the error...",48," Pharmacy System V.01")
> *              "Description:"+laError[2])
> 				*quit
> return

> it displays connection failed. What do you think I'm doing bad?
> Thanks in advance,
> joe

I wouldn't think that it is a problem related to using on an 64 bit windows. VFP itself is 32 bits and would use the 32 bits ODBC driver. I don't use MySQL so I can't speak for sure, but say, with MS SQL server when you install either MS SQL 32 bit or MS SQL 64 bits on a server, and have client ODBC drivers set, it registers both 32 and 64 drivers. From there on the application use one or the other, you don't do anything special in your application code (be it coded with VFP or not). If your application is 32 then it use 32 bit driver, if 64 then 64 bits driver.

I would suspect if the connection string parameters are right (server, database, username, password).

PS: Although I don't use MySQL myself, I had installed it on this Win 7 64 machine and simply connected giving right server, database ... And BTW, using localhost as the server name doesn't always work well with MS SQL too. You may need to edit LMHOSTS file for that or simply instead use the IP if you can connect with IP (in MS SQL you can simply use a . -DOT- to mean local computer). And may be I am interpreting your sentence wrong, if you installed MySQL to that computer, what driver you download. Server installation already installs client drivers, no? There were something called MySQL workbench? Did you check if you could connect there with these exact same parameters?

On a windows system I would prefer MS SQL really. Express version is free to use up to 10 Gb. Probably you can't because your code is already done based on MySQL :(

Cetin Basoz

Give some sample data in code for your question - here is the tool you need to generate the code

My Blog

MongoDb Certified Developer
MongoDb Certified DBA

Support Wikipedia


ODBC Connector driver (64bit) Posted by joe Degorio @ 1/15/2014 1:48:27 AM
RE: ODBC Connector driver (64bit) Posted by Tom Saddul @ 1/15/2014 4:14:16 AM
RE: ODBC Connector driver (64bit) Posted by David Mustakim @ 1/15/2014 4:16:14 AM
RE: ODBC Connector driver (64bit) Posted by Dany Eid @ 1/17/2014 8:25:13 AM
RE: ODBC Connector driver (64bit) Posted by joe Degorio @ 1/18/2014 3:36:19 PM
RE: ODBC Connector driver (64bit) Posted by Cetin Basoz @ 1/17/2014 1:50:56 PM
RE: ODBC Connector driver (64bit) Posted by joe Degorio @ 1/18/2014 3:27:42 PM