By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,255 Members | 2,773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,255 IT Pros & Developers. It's quick & easy.

Query sql sever temporary table through odbc

P: n/a
Hi,
Got some problems from reading temporary table I'm creating in my Sql
Server 2005 Database from Access 2K3 through ODBC.

I can create it successfully but can't find a way to query it !
The code below (the select part) returns me Microsoft Jet Engine Error
that tells me it can't find the object.

Any help would be most welcome !!

******
Dim strConnect As String
strConnect = "odbc;Driver={SQL Server};Server=" & DB_DEV_SERVER &
";Database=" & DB_DEV_DB & ";UID=" & DB_DEV_LOGIN & ";PWD=" &
DB_DEV_PWD

Dim db As Database
Set db = OpenDatabase("", dbDriverNoPrompt, False, strConnect)

Dim strSql As String

'Create Temporary Table : WORKS
strSql = "select * into [##Test] from Whatever"
db.Execute (strSql)

'Select : PROBLEM!!!!
strSql = "select * from [##Test]"
Dim rst As Recordset
Set rst = db.OpenRecordset(vTxt)

Jun 14 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.