Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Incorrect library(collection) name in TClientDataSet.ApplyUpdates

5 views
Skip to first unread message

Andy Wong

unread,
Dec 19, 2000, 12:33:29 PM12/19/00
to
I'm writing Delphi5 3-tier programs connecting to AS/400 using ODBC.
One TClientDataSet connecting to a TQuery with the SQL like this 'SELECT
fieldA, fieldB from collection.tableX'. It works just fine and data are read
from server and sent to client tier correctly.
However, when I execute the TClientDataSet.ApplyUpdate(-1) to apply some
updates to the server. From the SQL monitor in the middle tier, I found the
automatically generated update statements change to 'UPDATE collection set
fieldA = ?, set fieldB = ? ......' where the table name is missing.

Any idea how to solve this problem?


Sergei Korolev

unread,
Dec 20, 2000, 10:02:32 AM12/20/00
to
Use DatasetProvider's event OnGetTableName.


"Andy Wong" <an...@post1.com> wrote in message news:3a3f9c32_1@dnews...

Zhuo Li

unread,
Dec 20, 2000, 11:14:36 AM12/20/00
to
collection is your database name, right? Try to delete it.

Change to:

'SELECT fieldA, fieldB from tableX'

since you should already set the database name for the TQuery.

Zhuo


"Andy Wong" <an...@post1.com> wrote in message news:3a3f9c32_1@dnews...

Andy Wong

unread,
Dec 20, 2000, 11:20:32 AM12/20/00
to
Have to use collection/table to identify different table in different
collection.

"Zhuo Li" <l...@penad.ca> ????? news:91qhv9$7u...@bornews.inprise.com...

Andy Wong

unread,
Dec 20, 2000, 11:21:24 AM12/20/00
to
well, what code should i put in that event to correct the case?


"Sergei Korolev" <sergei...@hotmail.com> ?????
news:3a40c9ae$1_2@dnews...

Zhuo Li

unread,
Dec 20, 2000, 3:23:55 PM12/20/00
to
What is collection, dbowner or database name? whatever, you should be able
to set the database name and the SQL string for the TQuery dynamically. That
means the "collection." could be deleted.

Zhuo


"Andy Wong" <an...@post1.com> wrote in message news:3a40dca3_2@dnews...

Sergei Korolev

unread,
Dec 21, 2000, 2:05:31 AM12/21/00
to
Should be as follows:
begin
TableName := 'collection.tableX';
end;

"Andy Wong" <an...@post1.com> wrote in message news:3a40dcd8_1@dnews...

0 new messages