Re: VB with SQL Server... Unable to create temp table using ADO connection object
From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 05/06/04
- Next message: AlexEg: "Deadlock on SBS2003"
- Previous message: Dan Guzman: "Re: "exec into" related"
- In reply to: Peri: "Re: VB with SQL Server... Unable to create temp table using ADO connection object"
- Next in thread: Peri: "Re: VB with SQL Server... Unable to create temp table using ADO connection object"
- Reply: Peri: "Re: VB with SQL Server... Unable to create temp table using ADO connection object"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 6 May 2004 08:21:04 -0500
> I am not using connection pooling.
Try adding 'Pooling=False' to your connection string and specifying "SET
NOCOUNT ON" in your script:
objConn.Execute "SET NOCOUNT ON " & _
"SELECT * INTO ##TempScrip7569 " & _
"FROM [FormsDevp]..Scrip WHERE 1=2"
-- Hope this helps. Dan Guzman SQL Server MVP "Peri" <lperi@CSPL.com> wrote in message news:uOwNyl2MEHA.936@TK2MSFTNGP11.phx.gbl... > Hi, > > I am not using connection pooling. I am not able to create the temp table > even at the first time. > > FYI - While execute the SQL in VB, I am not getting any error. It seeems to > get executed, but when I query the temp table either in VB or in SQL server > query anaylyser, I get the error "Invalid Object.." > > Thanks and Regards, > > Peri > > "Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@avtenta.si> wrote in > message news:uw8Lq$1MEHA.556@tk2msftngp13.phx.gbl... > > My guess is that you have connection pooling, so even if you close the > > connection from the app, it is still in the pool and alive. So the global > > temp table is not destroyed, and when you try to create next time, the > > creation fails. > > > > -- > > Dejan Sarka, SQL Server MVP > > Associate Mentor > > Solid Quality Learning > > More than just Training > > www.SolidQualityLearning.com > > > > "Peri" <lperi@CSPL.com> wrote in message > > news:eyCkDh1MEHA.620@TK2MSFTNGP10.phx.gbl... > > > Hi, > > > > > > This is the connection string I am using: > > > > > > objConn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security > > > Info=False;User ID=sa;Initial Catalog=FormsDevp;Data Source=CSPL;Use > > > Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation > > > ID=PERI;Use Encryption for Data=False;Tag with column collation when > > > possible=False" > > > > > > I tried using all the 3 sql statements given below. > > > objConn.Execute "SELECT * INTO ##TempScrip7569 FROM [FormsDevp]..Scrip > > WHERE > > > 1=2" > > > OR > > > objConn.Execute "SELECT * INTO ##TempScrip7569 FROM Scrip WHERE 1=2" > > > OR > > > objConn.Execute "SELECT * INTO ##TempScrip7569 FROM Scrip WHERE > ScripCode > > IS > > > NULL" > > > > > > But I am not able to create a temp table with the same structure of the > > > original table "Scrip" with empty records. > > > > > > Suprisingly, If I run the same query in the SQL Server query analyser, I > > am > > > able to see the temp table. > > > > > > FYI - Reference to the Project - Microsoft ActiveX Data Objects 2.5 > > Library. > > > > > > Can any one help me to overcome this ? > > > > > > Thanks and Regards, > > > > > > Peri > > > > > > > > > > > >
- Next message: AlexEg: "Deadlock on SBS2003"
- Previous message: Dan Guzman: "Re: "exec into" related"
- In reply to: Peri: "Re: VB with SQL Server... Unable to create temp table using ADO connection object"
- Next in thread: Peri: "Re: VB with SQL Server... Unable to create temp table using ADO connection object"
- Reply: Peri: "Re: VB with SQL Server... Unable to create temp table using ADO connection object"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|