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