MySQL Forums
Forum List  »  Newbie

Problem with ADO UpdateBatch and table naming
Posted by: Nicklas Kittelmann
Date: September 03, 2004 09:16AM

I use ADO and I open a recordset from the SQL code:
"SELECT t1.ID, t1.Name, t1.Version, t2.SavedByUserID, t1.State
from MzArea as t1, MzArea as t2
where t1.ID=4 and
t1.Version in (select Max(Version) from MzArea where id=t1.id and (CheckedOutDateTime IS NULL or SavedByUserID=2)) AND
t2.Version in (select Max(Version) from MzArea where id=t2.id) AND
t1.id = t2.id AND
t2.State <> 'D' "
So far no problem.
The I do an AddNew to the Recordset and put some data in the new row.

Then, when I do an UpdateBatch to the Recordset I get the error:
"Microsoft OLE DB Provider for ODBC Drivers"
"[MySQL][ODBC 3.51 Driver][mysqld-4.1.4-gamma]Table 'mazermind_test18.t1' doesn't exist"

My databased is called "mazermind_test18" and my table is called "MzArea". Why does it then try to do something with the table "t1" (which doesn't exist). t1 is only the temoprary name in the SQL...
When I insert data, I only want the new data to be put in the t1 row.

Also, this works perfectly in SQLServer and Access, but not in MySQL.

Anyone knows of a workaround?

Options: ReplyQuote


Subject
Written By
Posted
Problem with ADO UpdateBatch and table naming
September 03, 2004 09:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.