Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trap error on tcursor.updateFromArray(arr)

Status
Not open for further replies.

mwylde

Programmer
Feb 17, 2003
12
GB
Hi - i'm performing a tcursor update from an array using the syntax myTC.updateFromArray(myArr) and its failing to update the record (actually a record on a MYSQL table via ODBC) - i can test whether it fails, but is there a way of trapping the specific error? ie.

if myTC.updateFromArray(myArr) then
... successs
else
... fail - how do i interrogate the system to get the reason for failing here????
endif

many Thanks, Martin.

 
Look at the errormessage() entry in HELP.

You might want to look at errorpop() as well, so you can get the complete stack of error messages (like when you get an error dialog on screen, and there is the >> for you to click to get the rest of the errors). Think while loop to set up a routine to pop them all.

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
I've just ran this with the debugger and i've noticed that the copyFromArray() is actually returning 'true' not false - so Paradox thinks the record has been updated although when i check the mysql database it shows it hasn't - i could maybe trap the error with an ODBC debugger/profiler, but any suggestion/ideas as to why the records are not updating and paradox is not trapping it would be very welcome.

[paradox v7 to mysql via odbc]

thanks,Martin.
 
Do you have errortraponwarnings(True) ?

How many fields/array elements?

Are you using a straight array, or dynarray?

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
apologies i'm new to Pdx - that got me a warning that wasn't trapped [on the endEdit() call]
'couldn't perform the edit because another user changed the record'

after googling the error it may be that my mysql database 'float' format is different from the paradox 'number' format [the link below points this out on a mssql db]


I have used this code to successfully copy a table thats just full of varchar and int formats - so it does seem to point to a format/structure mis alignment!

I'm using a dynArray to clone the source tcursor record to copy into the target tcursor pointed to a mysql db - i've also tried the copyRecord() to directly copy the tcursor and i get the same error - so i rekon it may be to do with some format/table differences between the paradox and mysql schemas - my paradox records are in number, date and alpha formats and the cooresponding mysql fields are in [mysql] real, date and varchar formats - althought the error looks like a user contention thing, there are currently no other users/processes using the databases so i'm guessing its no a user locking issue.

Again, any help greatly appreciated , also any pointers to code that anyone has written that transfers tables between pdx and mysql would be greatly appreciated.
Martin.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top