Need help with Ado

Need help with Ado

Postby Richard Chidiak » 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: Select all  Expand view


#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  Expand view

<?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
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Need help with Ado

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

Re: Need help with Ado

Postby Richard Chidiak » 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
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Need help with Ado

Postby Enrico Maria Giordano » Mon Nov 04, 2013 1:51 pm

Richard,

have you installed MySQL OLEDB driver in the client PC?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Need help with Ado

Postby Rick Lipkin » Mon Nov 04, 2013 1: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests