Question : can't drop table

This may not be an Access question, but I'l' try here first.

I am creating a temporary SQL Server table:

ado_execute "create table myTable (col1, co2, ...)", "PA"

That works fine and I can insert records. When I'm done and I go to drop the table:

ado_execute "drop table myTable"

I get the error: "Cannot drop the table 'myTable', because it does not exist in the system catalog."

When I run the program again I get: "There is already an object named 'myTable' in the database." and I get the same drop error when I close. When I go into SQL Server Enterprise Manager, the table is there.

What's up?

Answer : can't drop table

in sql server temporary taboes are prefixed by #

create table #myTable (col1, co2, ...)", "PA"

creates it in the tempdb, its dropped by the db automatically at the end when you kill you connection.

could you try that?

alternatively - if your user is "sudonim"

create table sudonim.myTable (col1, co2, ...)", "PA"

Random Solutions  
 
programming4us programming4us