MySql and AdoRdd

User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

MySql and AdoRdd

Post by Jeff Barnes »

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

#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????
Last edited by Jeff Barnes on Thu May 14, 2009 12:30 am, edited 1 time in total.
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: MySql and AdrRdd

Post by Jeff Barnes »

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 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Armando
Posts: 2479
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Contact:

Re: MySql and AdrRdd

Post by Armando »

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
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: MySql and AdrRdd

Post by Jeff Barnes »

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 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: MySql and AdrRdd

Post by Jeff Barnes »

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 12.01, xHarbour 1.2.1, Bcc582)
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: MySql and AdrRdd

Post by anserkk »

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. :D

Regards
Anser
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: MySql and AdrRdd

Post by dutch »

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 19.01 / 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)
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: MySql and AdrRdd

Post by Jeff Barnes »

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 12.01, xHarbour 1.2.1, Bcc582)
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: MySql and AdrRdd

Post by nageswaragunupudi »

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
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: MySql and AdrRdd

Post by Jeff Barnes »

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 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: MySql and AdrRdd

Post by Jeff Barnes »

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 12.01, xHarbour 1.2.1, Bcc582)
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: MySql and AdrRdd

Post by dutch »

Dear Jeff,

How do you edit it?

Thanks,
Dutch
Regards,
Dutch

FWH 19.01 / 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)
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: MySql and AdrRdd

Post by Jeff Barnes »

Hi Dutch,

This is what I did:

Code: Select all

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

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 12.01, xHarbour 1.2.1, Bcc582)
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: MySql and AdrRdd

Post by dutch »

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 19.01 / 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)
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: MySql and AdrRdd

Post by Jeff Barnes »

I tried that as well and also got that error.
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
Post Reply