MySql and AdoRdd

Re: MySql and AdrRdd

Postby JARO » Wed May 13, 2009 6: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
JARO
 
Posts: 30
Joined: Thu Oct 25, 2007 7:54 pm

Re: MySql and AdrRdd

Postby JARO » Wed May 13, 2009 6: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
JARO
 
Posts: 30
Joined: Thu Oct 25, 2007 7:54 pm

Re: MySql and AdrRdd

Postby Jeff Barnes » Wed May 13, 2009 6:36 pm

Hi JARO,

It still crashed at:

Patients->DBAPPEND()
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 AdoRdd

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

Re: MySql and AdoRdd

Postby nageswaragunupudi » Thu May 14, 2009 1: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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests