FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Need help with Ado
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Need help with Ado
Posted: Mon Nov 04, 2013 11:01 AM
Good morning

I need to use ADO to access an sql table on our website from our fwh application, we usually do all our sql job with php.

I have installed a new db and tables on a test website to do some tests . Remote access is authorized.

My external ports are authorized through firewall and router , an exception has also been created to authorize.

I can access tables without any problem with php from Chrome, but no way to access with ADO , i execute as an administrator.

If any one can help, i would be very grateful as i do not see what can be wrong.

I join the fw code and a small php that inserts records into the tbale , this one works OK

The code can be executed , tested with Harbour and xharbour same result.

Thanks for help

Richard

Code (fw): Select all Collapse
#INCLUDE "FIVEWIN.CH"
#INCLUDE "ado.CH"

function Main()
xCONNECT  := "Provider=MySQLProv;Data Source=sql3.freesqldatabase.com;User Id=sql321540;Password=kQ5*qY9*"

TRY
  ors := TOleAuto():New( "ADODB.Recordset" )
 CATCH
   MsgInfo("It seems that your PC does not have MDAC installed OR MDAC is corrupted.")
   RETURN NIL
END TRY
MsgInfo( "Object Created!")

oRs:CursorType     := 1        // opendkeyset
oRs:CursorLocation := 3        // local cache
oRs:LockType       := 3        // lockoportunistic

cSql := "SELECT * FROM client"

TRY
   oRs:Open( cSQL,xCONNECT )
CATCH oErr
   MsgInfo( "Error in Opening client table" )
   RETURN nil
END TRY

xBrowse( oRs )

return nil


Code (fw): Select all Collapse
<?php
mysql_connect("sql3.freesqldatabase.com","sql321540","kQ5*qY9*") or die("erreur de connection au serveur");
mysql_select_db("sql321540") or die("erreur de connection a la base de données clients");
$requette = "DELETE FROM client";
$resultat = mysql_query($requette);
$requette = "INSERT INTO client (licence_num,date_instal,date_fin_gar,utilisateur,telephone,mobile,ville,departement,version, sousversion,id_revendeur,cbati,procom,prorest,progarage,prodepot,procoif,probat,probatle,prosap,proautoent,propdv) VALUES ('1001','1987-02-01','2013-12-31','CBATI','','','FEUCHEROLLES','78','17','4c','RCC','1','1','1','1','1','1','1','1','1','1','1')";
$resultat = mysql_query($requette);
echo '1 Enregistrement';
mysql_close();
?>
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Need help with Ado
Posted: Mon Nov 04, 2013 11:49 AM

Richard,

Do you get this error ?

"erreur de connection au serveur"

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Need help with Ado
Posted: Mon Nov 04, 2013 12:11 PM

Antonio

NO the php runs OK

In the fwh program i get

Error in Opening client table

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Need help with Ado
Posted: Mon Nov 04, 2013 01:51 PM

Richard,

have you installed MySQL OLEDB driver in the client PC?

EMG

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Need help with Ado
Posted: Mon Nov 04, 2013 01:53 PM

Richard

Have a look at this website and make sure you have the correct OldDb client ( as enrico suggests ) .. As far as your code and connection string, it appears syntactically your code should work .. ( I would remove #Include Ado.ch" ).

https://cherrycitysoftware.com/CCS/Prov ... MySQL.aspx

Rick Lipkin

Continue the discussion