Hi there,
I mainly use MySQL on the web server for data storage and I read them by using PHP scripts. Until now it worked fine but now I'm looking for a solution where is possible to connect with database on web server from VFP and to read few records or write them there. In order to ensure some security environment I used putty and this program did it OK: on the screen is black terminal window with visible and working prompt; then I disabled ZoneAlarm and even antivirus-software to ensure non-stoppable connection. I installed MySQL ODBC connectivity 3.51.12.00 and my forms in VFP9 on Win7 locally works great and fast, but when I change connection parameter in order to connect with remote MySQL it fails! After start of forms it looks like something will happen but mouse pointer is in state Busy and nothing more. Form is frozen, I can't click anything until I wrote exit in terminal window made by putty, and then I got error message like ODBC doesn't exist (Can't find driver)!
Is there some option to check is connection established, beside classic variable:
It seems like program control never reach IF... part because button command doesn't change its caption. Any help, please? Thank you.
There is no good nor evil, just decisions and consequences.
I mainly use MySQL on the web server for data storage and I read them by using PHP scripts. Until now it worked fine but now I'm looking for a solution where is possible to connect with database on web server from VFP and to read few records or write them there. In order to ensure some security environment I used putty and this program did it OK: on the screen is black terminal window with visible and working prompt; then I disabled ZoneAlarm and even antivirus-software to ensure non-stoppable connection. I installed MySQL ODBC connectivity 3.51.12.00 and my forms in VFP9 on Win7 locally works great and fast, but when I change connection parameter in order to connect with remote MySQL it fails! After start of forms it looks like something will happen but mouse pointer is in state Busy and nothing more. Form is frozen, I can't click anything until I wrote exit in terminal window made by putty, and then I got error message like ODBC doesn't exist (Can't find driver)!
Is there some option to check is connection established, beside classic variable:
Code:
query1="SELECT * FROM mytable1"
*parameters:
lcStringConn="Driver={MySQL ODBC 3.51 Driver};Server=&lcServer;Port=3306;Option=16384;Stmt=;Database=&lcDatabase;Uid=&lcUser;Pwd=&lcPassword"
* don't show a window login
*SQLSETPROP(0,"DispLogin",1)
lnHandle=SQLSTRINGCONNECT(lcStringConn)
*if all is fine
IF lnHandle > 0
thisform.label7.Caption='-connected-'
thisform.label7.ForeColor=RGB(0,255,0)
rez=SQLEXEC(lnHandle, query1, "ccursor")
ELSE
thisform.label7.Caption='-disconnected-'
thisform.label7.ForeColor=RGB(255,0,0)
=AERROR(laError)
? laerror
MESSAGEBOX("Error "+CHR(13)+;
"note:"+laError[2])
ENDIF
There is no good nor evil, just decisions and consequences.