Temporary Tables can not be found..

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
josh
Posts: 4
Joined: Thu 07 May 2009 08:28

Temporary Tables can not be found..

Post by josh » Tue 12 May 2009 08:47

Hi!
I am using Delphi 7 and I have a MSQuery component which creates a temporary table. This component's query is parameterized. If I try to access the temporary table after creating it the table can not be found. If I don't use parameters and manually create the sql query and put it in the component using sql.add I can access the temporary table with a problem. Is there an option I have to set? What am i doing wrong?

Josh

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Wed 13 May 2009 12:52

Please specify the version of server you are using.

josh
Posts: 4
Joined: Thu 07 May 2009 08:28

Post by josh » Wed 13 May 2009 19:31

ms sql server 2008 enterprise edition

tonisanta
Posts: 55
Joined: Wed 04 Apr 2007 17:25

Post by tonisanta » Mon 18 May 2009 07:08

Hi, could it be you are closing the connection after creating the temp-table and reopening it before accessing the table again? I had a similar problem when creating a temp-table from one connection and accessing it from another: when closing the connection (SPID) which created the table, the temporary table was destroyed still if there was other cocnections accessing it. Hope this helps.
best regards
Toni

josh
Posts: 4
Joined: Thu 07 May 2009 08:28

Post by josh » Mon 18 May 2009 08:48

i'm definitely not closing the connection. i made a example application where i basically try what i explained above.
the working example:
i connect. i create the the temp table. i query the temp table.

the example that doesn't work:
i connect. i create the the temp table. i set the query's paramters. i query the temp table. i reveive an error message saying the table does not exist


josh

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Mon 18 May 2009 11:10

We could not reproduce the problem. Please send us a small sample to reproduce it.

Post Reply