Problems using filters

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bernr
Posts: 17
Joined: Fri 14 Dec 2007 22:07

Problems using filters

Post by bernr » Fri 14 Dec 2007 22:33

I keep getting an error if I do an insert to a table that had filters.
If I do some thing like

Code: Select all

Table.Open;
Table.Filter:=' some filter';
Table.Filtered:=true;
...some code...
Table.Filtered:=false;
Table.Insert;
Table.Fieldbyname('').asstring:=somevalue;
Table.Fieldbyname('').asstring:=somevalue;
Table.Fieldbyname('').asstring:=somevalue;
Table.Fieldbyname('').asstring:=somevalue;
Table.Post.
Table.Close
If in the Insert I try to fill in a value for the last field in a Table then I get an error like
---------------------------
Debugger Exception Notification
---------------------------
Project test.exe raised exception class EMSError with message 'Column name 'test' appears more than once in the result column list.
Column name 'test' appears more than once in the result column list.
Column name 'test' appears more than once in the result column list.
Column name 'test' appears more than once in the result column list.'.
---------------------------
Break Continue Help
---------------------------
Now if I don't do the

Code: Select all

Table.Filter:=' some filter';
Table.Filtered:=true;
then the in insert works fine.
Or if I close and reopen the table before the insert then it works.
Or if I do use the filter and don't access the last field of the table then it works.

Any Suggestions?

Using Delphi in Rad Studio 2007
SDAC 4.30.0.13
Bern

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 17 Dec 2007 13:08

I could not reproduce the problem.
Please send me a complete small sample at sdac*crlab*com to demonstrate it, including script to create and fill table.

Also supply me the following information:
- exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- exact version of your IDE;
- exact version of SQL server and client. You can see it in the Info sheet of TMSConnection Editor.

Post Reply