Page 2 of 2

Re: MySql and AdrRdd

Posted: Wed May 13, 2009 6:20 pm
by JARO
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

Re: MySql and AdrRdd

Posted: Wed May 13, 2009 6:30 pm
by JARO
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

Re: MySql and AdrRdd

Posted: Wed May 13, 2009 6:36 pm
by Jeff Barnes
Hi JARO,

It still crashed at:

Patients->DBAPPEND()

Re: MySql and AdoRdd

Posted: Thu May 14, 2009 12:33 am
by Jeff Barnes
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

function APPENDADO()
  local nWA := Select()
  local oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]
  oRecordSet:AddNew()
  oRecordSet:Update()
return nil

Re: MySql and AdoRdd

Posted: Thu May 14, 2009 1:33 am
by nageswaragunupudi
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.