Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / December 2007



Tip: Looking for answers? Try searching our database.

ASP & Temporary Tables - Create OK, then "Not Found"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bookham Measures - 19 Dec 2007 18:33 GMT
Hi

Classic ASP and SQL 2005.  In my ASP I issue a create table statement:

   objConn.Execute "CREATE TABLE #PCUserIDs (UserID int NOT NULL, EKM
numeric (6, 2) NULL, NKM numeric (6, 2) NULL)", , adCmdText +
adExecuteNoRecords

Then, later on I attempt to access it from within a stored procedure:

   objConn.Execute "EXEC usp_Search_OvernightRates", , adCmdText +
adExecuteNoRecords

and I am told that #PCUserIDs does not exist:

   Invalid object name '#PCUserIDs'.

Can anyone help?  When I use profiler I see an Audit Logout and Audit Login.
This shouldn't be happening, as the connection is not closed or anything.

Regards
David
Bob Barrows [MVP] - 19 Dec 2007 18:55 GMT
> Hi
>
[quoted text clipped - 16 lines]
> Login. This shouldn't be happening, as the connection is not closed
> or anything.

By "later on", do you mean "later on in the same page"? Can you
reproduce the problem by doing this?

   objConn.Execute "CREATE TABLE #PCUserIDs (UserID int NOT NULL, EKM
numeric (6, 2) NULL, NKM numeric (6, 2) NULL)", , adCmdText +
adExecuteNoRecords
   objConn.Execute "EXEC usp_Search_OvernightRates", , adCmdText +
adExecuteNoRecords

How about by doing this?
   objConn.Execute "CREATE TABLE #PCUserIDs (UserID int NOT NULL, EKM
numeric (6, 2) NULL, NKM numeric (6, 2) NULL)", , adCmdText +
adExecuteNoRecords
   objConn.Execute "Insert #PCUserIDs Values(1,238,3)", , adCmdText +
adExecuteNoRecords

Signature

Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.