Porting FW to FWH using MySql

Porting FW to FWH using MySql

Postby wzaf » Thu Feb 04, 2010 10:28 am

Hi all,
I'm porting my applications from FW to FWH .

I use MySql , and in FW I used class TDbOdbc in this way :
oDbf := TDbOdbc():new("SELECT * FROM mytab....... " , oOdbc)
and then I scan ODbf structure to retrieve data .

I use this method also in FWH and it work fine: why Antonio says that Tdbodbc is only for 16 bits ?
Is there any warning ?

best regards

wzaf
wzaf
 
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Postby Antonio Linares » Sun Feb 07, 2010 8:30 am

Wzaf,

You can also use Class TDbODBC in 32 bits if you need it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Porting FW to FWH using MySql

Postby wzaf » Sun Feb 07, 2010 6:29 pm

Thank you for your answer, Antonio ,

Anyway i started to port my programs to ADO and Adordd (with some difficulties) .
I use ADODB.connection and ADODB.recordset object, but I'm not able to find documentation: Do you know where I can find it ?


Best regards
Wzaf.
wzaf
 
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Postby anserkk » Mon Feb 08, 2010 4:11 am

Dear Mr.Wzaf,

I'm not able to find documentation: Do you know where I can find it ?

http://www.w3schools.com/ado/default.asp

Regards
Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Postby wzaf » Mon Feb 08, 2010 12:31 pm

Tank you Anser,
a very good site.

I still have a difficulty to handle the errors on a 'connection:execute' command :
Do you know how to catch the returned errors ?

Tank you

Regards

Wzaf
wzaf
 
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Postby anserkk » Tue Feb 09, 2010 6:56 am

Dear Mr.Wzaf,

Code: Select all  Expand view  RUN
Local oError
TRY
   oCmd:Execute()
CATCH oError
     MsgInfo( " Error No:  "+AllTrim(STR(oError:NativeError))+CRLF+;
          " Description :  "+oError:Description)
END 


Regards
Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Postby wzaf » Tue Feb 09, 2010 8:34 am

Dear Anser,

Thank you , but I already tried this method and I get : "No exported method: NATIVEERROR" ,
instead the "oError:description" works fine.

Best regards
Wzaf
wzaf
 
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Postby anserkk » Tue Feb 09, 2010 9:20 am

Dear Mr.Wzaf,

I hope that u r using ADO. Can u please provide the following info.

MySQL Ver
ODBC Driver ver
Your connection string

Regards
Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Postby wzaf » Tue Feb 09, 2010 9:46 am

Dear Anser

Here they are :

mysql: 5.0.67
odbc: mysql ODBC 5.1 driver : 5.01.06.00
cConnectString := "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=mydb; User=myuser;Password=mypassw;Option=3"


best regards

Wzaf
wzaf
 
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Postby anserkk » Tue Feb 09, 2010 9:55 am

Are you able to connect to the database ?. If not please try the following con. string
Try the following connection string
Code: Select all  Expand view  RUN
"Driver={MySQL ODBC 5.1 Driver};Server=192.168.0.170;Port=3306;Database=YourDbName;User=YourUserName;Password=YourPassword;Option=3;"


Regards
Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Postby wzaf » Tue Feb 09, 2010 10:11 am

Anser ,

All works fine : I connect successfully : I correctly do SELECT and UPDATE in database.
I'm not able to correctly view the ADO errors (if there are...)

Regards
Wzaf
wzaf
 
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Postby anserkk » Tue Feb 09, 2010 10:27 am

Dear Mr.Wzaf,

Code: Select all  Expand view  RUN
*---------------------------------------------------*
Function ShowSqlError(oError)
*---------------------------------------------------*
FOR EACH oError IN oApp:oConnection:Errors
   MsgInfo( " Error No:  "+AllTrim(STR(oError:NativeError))+CRLF+;
          " Descripcion :  "+oError:Description, oApp:cAppName)
   oApp:nLastErrorNo:=oError:NativeError
NEXT
RETURN ( NIL )


Regards
Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Postby wzaf » Tue Feb 09, 2010 10:56 am

Thank you Anser , but what is object oApp ?

regards
Wzaf
wzaf
 
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Postby anserkk » Tue Feb 09, 2010 11:19 am

Mr.Wzaf,

Instead of oApp:oConnection you may use your Connection Object

Code: Select all  Expand view  RUN
*---------------------------------------------------*
Function ShowSqlError(oConnection)
*---------------------------------------------------*
FOR EACH oError IN oConnection:Errors
   MsgInfo( " Error No:  "+AllTrim(STR(oError:NativeError))+CRLF+;
          " Descripcion :  "+oError:Description)
 NEXT
RETURN ( NIL )


Regards
Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Postby wzaf » Tue Feb 09, 2010 1:34 pm

Dear Anser,
sorry but doesn't work
I get always "Argument error: __OLEENUMCREATE"

in line :
FOR EACH oError IN oConnection:Errors



regards
Wzaf
wzaf
 
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests