Metadata issue with ADO

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Locked
zx
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 13.10.2005, 14:05

Metadata issue with ADO

Post by zx »

[problem]
i have a couple of databases - db1 and db2 on the same server.
i connect to server via zConnection with ADO protocol and say that
mine current database is db1 (with connection string or
directly with USE query - does not matter).

next i take a zQuery named dsQuery, set its SQL into:
'select * from db2.dbo.tablenamex',
set it's RequestLive to true
(or readonly to false if you like) and open it.
next i do dsQuery.open, focus some record,
update it executing dsQuery.edit and modifying fields.
and when we do dsQuery.post it internally forms sql string like:
'update tablenamex set fieldname=_value_, ... where keyfield=_value_'
and so on, but it puts 'tablenamex' there instead of 'db2.dbo.tablenamex'.
thus we can not modify data in database other then current using
zQuery with .edit and .post.

to make it possible it is enough to uncomment the following strings:

[suggested solution]
(scope)
======== [dbc\ZDbcAdoMetadata.pas] ========
function TZAdoDatabaseMetadata.GetColumns(...): IZResultSet;
(origin)
{
Result.UpdateStringByName('TABLE_CAT',
''{GetStringByName('TABLE_CATALOG')});
Result.UpdateStringByName('TABLE_SCHEM',
''{GetStringByName('TABLE_SCHEMA')});
}
(change into)
{
Result.UpdateStringByName('TABLE_CAT',
GetStringByName('TABLE_CATALOG'));
Result.UpdateStringByName('TABLE_SCHEM',
GetStringByName('TABLE_SCHEMA'));
}

but WHY this lines were commented that way is still a mistery for me.
so i understand that uncommenting it may lead not only to enabling
the features i need but also to damaging something i do not expect.

thus i ask respected developers to check it out and to make a
decision how to enable such a behaviour in a safe way.

[platform notes]
zeosdbo-6.5.1-alpha_cvs_13-10-2005
protocol: ado
delphi7
Microsoft SQL server 2000

best wishes.
Michael
ZeosLib's Handyman :o)
ZeosLib's Handyman :o)
Posts: 189
Joined: 15.08.2005, 16:08
Location: Wehrheim
Contact:

Post by Michael »

Hi zx,

could you please create a new bug report in the bug tracker at SourceForge. This would be very nice. ;-)

Tanks in advance.
:prog2: Use the source, dude!

[align=right]..::.. ZeosLib on SourceForge ..::..[/align]
Locked