Thanks Erland
You were right.
ADO is opening an extra connection thats why it is not working and the
second example is working because only one record was inserted. If I
change to second code to:
cnn.Execute("INSERT INTO #testtable VALUES('5','4')")
cnn.Execute("INSERT INTO #testtable VALUES('2','3')") ---- inserting
second row
Then it is not working, same as the first example.
As you have suggested in your previous email to use a static client-side
cursor, I have change to code to:
set rst_tre = Server.CreateObject("ADODB.RecordSet"
rst_tre.CursorLocation = 1 '-- adUseClient
rst_tre.CursorType = 3 '-- adOpenStatic
rst_tre.LockType = 2 -- adLockOptimistic
sql_tre = "SELECT category, product INTO #testtable FROM products"
rst_tre.Open sql_tre,cnn
SET rst_tre = nothing
But it is still not working.
Any suggestion why?
I head a look at some logs from SQL:
SQL:BatchCompleted; SELECT category, product INTO #testtable FROM
products
SQL:BatchCompleted; SELECT * from #testtable
Audit Login -- network protocol:
SQL:BatchCompleted SELECT * from #testtable
Audit Logout
Any suggestions why ADO opens another connection after opening the
#testtable for the first time?
Another think I have noticed is that when I open the #testtable only
once it is working fine.
Thanks,
Gonzal
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!