Porting FW to FWH using MySql

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

Porting FW to FWH using MySql

Post by wzaf »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Porting FW to FWH using MySql

Post by Antonio Linares »

Wzaf,

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

Antonio Linares
www.fivetechsoft.com
wzaf
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Post by wzaf »

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.
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Post by anserkk »

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
wzaf
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Post by wzaf »

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
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Post by anserkk »

Dear Mr.Wzaf,

Code: Select all

Local oError
TRY
   oCmd:Execute()
CATCH oError
     MsgInfo( " Error No:  "+AllTrim(STR(oError:NativeError))+CRLF+;
          " Description :  "+oError:Description)
END 
Regards
Anser
wzaf
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Post by wzaf »

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
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Post by anserkk »

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
wzaf
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Post by wzaf »

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
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Post by anserkk »

Are you able to connect to the database ?. If not please try the following con. string
Try the following connection string

Code: Select all

"Driver={MySQL ODBC 5.1 Driver};Server=192.168.0.170;Port=3306;Database=YourDbName;User=YourUserName;Password=YourPassword;Option=3;"
Regards
Anser
wzaf
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Post by wzaf »

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
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Post by anserkk »

Dear Mr.Wzaf,

Code: Select all

*---------------------------------------------------*
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
wzaf
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Post by wzaf »

Thank you Anser , but what is object oApp ?

regards
Wzaf
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Porting FW to FWH using MySql

Post by anserkk »

Mr.Wzaf,

Instead of oApp:oConnection you may use your Connection Object

Code: Select all

*---------------------------------------------------*
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
wzaf
Posts: 38
Joined: Tue Sep 30, 2008 11:16 am

Re: Porting FW to FWH using MySql

Post by wzaf »

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

in line :
FOR EACH oError IN oConnection:Errors



regards
Wzaf
Post Reply