FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour MySql and AdoRdd
Posts: 30
Joined: Thu Oct 25, 2007 07:54 PM
Re: MySql and AdrRdd
Posted: Wed May 13, 2009 06:20 PM
Jeff (sorry my english is very bad)
So add record
First, if you database contain a primary key. you have update this field
Your example
suppose that primary key name is "CODE"

#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 bottom
ncode:=Patients->code //primary key
Patients->DBAPPEND())
Patients->FIELDPUT(fieldpos("CODE "), ncode)) //primary key
Patients->FIELDPUT(fieldpos("Last "), "xxxxxxxxxxx"))
BROWSE()
USE
return nil

About the error " to many recursive error I can't say anything, it always shows when you have any error. see this example

Function Main()
msginfo(hola) //error ok variable not exist => error.log
USE Fusion VIA "ADORDD" TABLE "patients" MYSQL FROM "127.0.0.1" USER "fusion" PASSWORD "fusion" ALIAS "Patients"
go bottom
BROWSE()
USE
return nil

Function Main()
USE Fusion VIA "ADORDD" TABLE "patients" MYSQL FROM "127.0.0.1" USER "fusion" PASSWORD "fusion" ALIAS "Patients"
msginfo(hola) //bad error "too many recursive..
go bottom
BROWSE()
USE
return nil
I don´t not why
Posts: 30
Joined: Thu Oct 25, 2007 07:54 PM
Re: MySql and AdrRdd
Posted: Wed May 13, 2009 06:30 PM
SORRY

TO ADD RECORDS
function Main()
USE Fusion VIA "ADORDD" TABLE "patients" MYSQL FROM "127.0.0.1" USER "fusion" PASSWORD "fusion" ALIAS "Patients"
go bottom
ncode:=Patients->code +1//primary key, IF YOU HAVE ANY PROBLEM USE DATABASE SORT BY PRIMARY KEY
Patients->DBAPPEND())
Patients->FIELDPUT(fieldpos("CODE "), ncode)) //primary key
Patients->FIELDPUT(fieldpos("Last "), "xxxxxxxxxxx"))
BROWSE()
USE
return nil

TO MODIFY RECORDS
function Main()
USE Fusion VIA "ADORDD" TABLE "patients" MYSQL FROM "127.0.0.1" USER "fusion" PASSWORD "fusion" ALIAS "Patients"
ncode:=Patients->code//primary key
Patients->DBAPPEND())
Patients->FIELDPUT(fieldpos("CODE "), ncode)) //primary key
Patients->FIELDPUT(fieldpos("Last "), "xxxxxxxxxxx"))
BROWSE()
USE
return nil
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: MySql and AdrRdd
Posted: Wed May 13, 2009 06:36 PM

Hi JARO,

It still crashed at:

Patients->DBAPPEND()

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: MySql and AdoRdd
Posted: Thu May 14, 2009 12:33 AM
Anybody know how to do an Append via AdoRdd ?

Anyway I can mix Adordd and Ado just to get somethnig working?

I tried adding this to my app but failed at oRecordSet:Update():

Code (fw): Select all Collapse
function APPENDADO()
  local nWA := Select()
  local oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]
  oRecordSet:AddNew()
  oRecordSet:Update()
return nil
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MySql and AdoRdd
Posted: Thu May 14, 2009 01:33 AM

Mr Jeff

For me both replace and dbappend are working perfectly with ADORDD. I am using the latest adordd.prg from xharbour.org. Please make sure you have the latest. If you can email me at nageswaragunupudi@gmail.com, I can send the prg file I am using. In my view you should not get into any of these problems with ADORDD.

You can intermix both ADO and ADORDD.

Personally I prefer and advise using ADO directly, because we are fully aware of what is going on in our program. It is really very simple.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion