Cadena conexion ADO / MYSQL

Cadena conexion ADO / MYSQL

Postby Compuin » Fri Aug 12, 2022 7:05 pm

Saludos foro,

Quien me puede decir como crear la cadena de conexion con ADO para MYSQL ?

Gracias de antemano
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Cadena conexion ADO / MYSQL

Postby Baxajaun » Fri Aug 12, 2022 7:24 pm

Buenas !!!

Dale un vistazo a https://www.connectionstrings.com/mysql/.

Saludos,
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Re: Cadena conexion ADO / MYSQL

Postby Compuin » Fri Aug 12, 2022 7:29 pm

Muchas gracias

Mi otra duda es que conector mysql debo instalar para ADO?

Tengo mysql 5.7

Gracias
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Cadena conexion ADO / MYSQL

Postby Baxajaun » Fri Aug 12, 2022 7:57 pm

Prueba con la versión 5.2.7 https://downloads.mysql.com/archives/c-odbc/

Saludos,
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Re: Cadena conexion ADO / MYSQL

Postby Compuin » Fri Aug 12, 2022 8:02 pm

Baxajaun wrote:Prueba con la versión 5.2.7 https://downloads.mysql.com/archives/c-odbc/

Saludos,


Gracias, ya lo descargue e instale.

Ahora debo configurar algo mas porque aun no me permite conexion
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Cadena conexion ADO / MYSQL

Postby Baxajaun » Sat Aug 13, 2022 9:55 am

Hola,

si colocas por aquí el error o errores, se te podrá ayudar.

Muchas gracias.

Saludos,
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Re: Cadena conexion ADO / MYSQL

Postby nageswaragunupudi » Thu Sep 01, 2022 7:58 am

1. Download and install ODBC driver as advised above.
2. You need not worry about connection string. FWH functions will automatically and transparently do it for you.
Code: Select all  Expand view
oCn := FWOpenAdoConnection( { "MYSQL", <serveraddress>, <database>, <user>, <password> } )
if oCn == nil
   ? "Connect fail"
return nil

// success
// proceed with your work
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Cadena conexion ADO / MYSQL

Postby horacio » Sun Sep 04, 2022 2:55 pm

Hola, Desde que versión está disponible FWOpenAdoConnection()?. Gracias

Saludos
horacio
 
Posts: 1363
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Cadena conexion ADO / MYSQL

Postby nageswaragunupudi » Sun Sep 04, 2022 5:38 pm

Very old function
Prior to 1401
please check if you have fwh\source\function\adofuncs.prg
May I know what is your version?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Cadena conexion ADO / MYSQL

Postby horacio » Thu Sep 08, 2022 4:58 pm

Hola Rao, uso la versión 20.04 sin embargo en en el módulo adofuncs.prg figura de esta manera.

Code: Select all  Expand view

function Fw_OpenAdoConnection( cConnStr, lShowError )
 


Faltan parámetros de acuerdo con su ejemplo
Saludos
horacio
 
Posts: 1363
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Cadena conexion ADO / MYSQL

Postby nageswaragunupudi » Thu Sep 08, 2022 6:05 pm

If you provide the 1st parameter as an array like this
Code: Select all  Expand view
{ "MYSQL", <serveraddress>, <database>, <user>, <password> }

the function will convert data from this array into a connection string and will use it to connect.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests