Creating table with unique name

User avatar
silverback
5StarLounger
Posts: 771
Joined: 29 Jan 2010, 13:30

Creating table with unique name

Post by silverback »

I need to create a table (using VBA) which is only accessible within a single session.

I've tried to create a temporary table using

strSQL = "CREATE TEMPORARY TABLE tablename(fieldname fieldtype)"
DoCmd.RunSQL strSQL
but the SQL fails with a syntax error until I remove the word TEMPORARY.

Alternatively, is there a way of creating a table with a unique name eg by using something like a session ID?

Thanks
Silverback

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Creating table with unique name

Post by HansV »

You could store a table with a fixed name in the user's frontend database. Just make sure you delete it when you're done with it.
Best wishes,
Hans