MySql and AdoRdd

MySql and AdoRdd

Postby Jeff Barnes » 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: Select all  Expand view

#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 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: MySql and AdrRdd

Postby Jeff Barnes » Tue May 12, 2009 1: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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: MySql and AdrRdd

Postby Armando » Tue May 12, 2009 1: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
User avatar
Armando
 
Posts: 3211
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: MySql and AdrRdd

Postby Jeff Barnes » Tue May 12, 2009 2: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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: MySql and AdrRdd

Postby Jeff Barnes » Tue May 12, 2009 2: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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: MySql and AdrRdd

Postby anserkk » Tue May 12, 2009 5: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. :D

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: MySql and AdrRdd

Postby dutch » Tue May 12, 2009 8: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 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
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: MySql and AdrRdd

Postby Jeff Barnes » Tue May 12, 2009 6: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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: MySql and AdrRdd

Postby nageswaragunupudi » Tue May 12, 2009 9: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
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MySql and AdrRdd

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

Re: MySql and AdrRdd

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

Re: MySql and AdrRdd

Postby dutch » Wed May 13, 2009 8:33 am

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
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: MySql and AdrRdd

Postby Jeff Barnes » Wed May 13, 2009 12:43 pm

Hi Dutch,

This is what I did:

Code: Select all  Expand view

#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  Expand view
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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: MySql and AdrRdd

Postby dutch » Wed May 13, 2009 4: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 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
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: MySql and AdrRdd

Postby Jeff Barnes » Wed May 13, 2009 5:04 pm

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

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests