Page 1 of 1

Need help with Ado

Posted: Mon Nov 04, 2013 11:01 am
by Richard Chidiak
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: Select all


#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: Select all

<?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();
?>
 

Re: Need help with Ado

Posted: Mon Nov 04, 2013 11:49 am
by Antonio Linares
Richard,

Do you get this error ?

"erreur de connection au serveur"

Re: Need help with Ado

Posted: Mon Nov 04, 2013 12:11 pm
by Richard Chidiak
Antonio

NO the php runs OK

In the fwh program i get

Error in Opening client table

Richard

Re: Need help with Ado

Posted: Mon Nov 04, 2013 1:51 pm
by Enrico Maria Giordano
Richard,

have you installed MySQL OLEDB driver in the client PC?

EMG

Re: Need help with Ado

Posted: Mon Nov 04, 2013 1:53 pm
by Rick Lipkin
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