FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour MySql and AdoRdd
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
MySql and AdoRdd
Posted: Tue May 12, 2009 12:01 AM
Hi Everybody,

After many posts and lots of help I am getting closer to using an SQL database....

I was able to get my friend to let me use MySql and have the following code connecting to my test database

Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "ADORDD.ch"   

REQUEST ADORDD

Function Main()
   USE fusion VIA "ADORDD" TABLE "patients" MYSQL FROM "127.0.0.1" USER "fusion" PASSWORD "fusion"
   browse()
   USE
return nil


My problem is I get an error (always the same error) whenever I try to do anything to the data.
Browse, Append even a simple "Count To " causes the error.

The error is:

Unrecoverable error 9003:
Too many recursive error handler calls

I am so close and just need some guidance as to why I am getting this error.

Any ideas????
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: MySql and AdrRdd
Posted: Tue May 12, 2009 01:47 AM

Update....

If I add MsgInfo( e:Description ) to errsysw.prg it tells me:

DISP_E_UNKNOWNNAME

But what name is it referring to?

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: MySql and AdrRdd
Posted: Tue May 12, 2009 01:58 AM

Jeff:

I'm afraid you are in a wrong way because there are not enough info about AdoRdd, I think the best way is to use ADO pure, you can search and found enough info in this forum.

Have a look to this link.

http://www.w3schools.com/ado/default.asp

Best regards and I'm so sorry for my poor english

Armando

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: MySql and AdrRdd
Posted: Tue May 12, 2009 02:05 AM

Never Mind.

I did not have records in the database :oops:

It works now. My very first successful MySql connection :D

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: MySql and AdrRdd
Posted: Tue May 12, 2009 02:10 AM

I spoke too soon ... I can browse the database but I get the same error when I try to add/modify the data.

Any ideas as to where I am going wrong?

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: MySql and AdrRdd
Posted: Tue May 12, 2009 05:08 AM
Dear Mr.Jeff,

I can browse the database but I get the same error when I try to add/modify the data.

If you have VARCHAR columns in the Table and if you try to add a Character type data without an Rtrim/Alltrim, then you may get error. That is just one of the reason and it is a very common mistake. There are other reasons too.

It is just a suggestion. As Mr.Armando suggested, I think it is better to use ADO instead of ADORDD. You will find lot of information and samples on how to use ADO in this forum as well as in the web. :-)

Regards
Anser
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: MySql and AdrRdd
Posted: Tue May 12, 2009 08:38 AM

I can open MySql with ADORDD as Jeff example BUT cannot append or delete or modify record. It alway shows an error.
Anyone could help and example for these cases?

Regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: MySql and AdrRdd
Posted: Tue May 12, 2009 06:22 PM

Thanks Armando and Anserkk for you idea of using ADO directly, however, currently I would like to stick with the xbase style control over the database.
I really don't have the time to learn the ADO format :(

Does anyone know how to allow access to adding / modifying the data via an ADORDD connection?

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MySql and AdrRdd
Posted: Tue May 12, 2009 09:59 PM

I do not use ADORDD normally. I use ADO directly.
But for this post I tested with ADORDD of xharbour.
I made only one small change in the adordd.prg. Changed the driver from 3.51 to 5.1.
ADORDD is working fine for me. I am able to add rows and modify rows.
Unless opened in exclusive mode, we should not forget locking and unlocking as we do in normal RDDs.

Personally I prefer using ADO directly, but for most pruposes ADORDD works fine.

Regards



G. N. Rao.

Hyderabad, India
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: MySql and AdrRdd
Posted: Tue May 12, 2009 11:54 PM

I tried installing the 5.1 version of the MySql ODBC driver and made the change to Adordd.prg --- still errors every time I try to add or modify :cry:

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: MySql and AdrRdd
Posted: Wed May 13, 2009 12:59 AM

Almost there...

I am now able to edit the data (I removed both odbc drivers then installed just the 5.1 driver to try an clean things up a bit)

I still get errors when I try to append a record.

Anyone know how to get around this?

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: MySql and AdrRdd
Posted: Wed May 13, 2009 08:33 AM

Dear Jeff,

How do you edit it?

Thanks,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: MySql and AdrRdd
Posted: Wed May 13, 2009 12:43 PM
Hi Dutch,

This is what I did:

Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "ADORDD.ch"  
REQUEST ADORDD

Function Main()
   USE Fusion VIA "ADORDD" TABLE "patients" MYSQL FROM "127.0.0.1" USER "fusion" PASSWORD "fusion" ALIAS "Patients"
   go top
   Patients->Last := "xxxxxxxxxxx"
   BROWSE()   
   USE
return nil


If you do not use the "ALIAS" clause then you will need to try:

Code (fw): Select all Collapse
Fusion->Last := "xxxxxxxxxxx"



Still can't figure out how to append a new record ... get an error every time I try.
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: MySql and AdrRdd
Posted: Wed May 13, 2009 04:59 PM

Thanks Jeff,

I found the function ADO_APPEND() in ADORDD.PRG but I don't understand why it cannot use. It shows the error "Unresolved external '_HB_FUN_ADO_APPEND'".

Regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: MySql and AdrRdd
Posted: Wed May 13, 2009 05:04 PM

I tried that as well and also got that error.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)