Lookup executes 3 time upon Recordset.Save

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Getting really strange problem using Recordset.Save: my SQL command gets
executed three times (tested on SQL Server 2000 and 2005 using both sqloledb
and {SQL Server} drivers):

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open("Driver={SQL Server}; Server=localhost; Database=DBname; User
ID=Username; Password='password'")
Set RS = objConn.Execute("SET NOCOUNT ON; SELECT ID FROM Products; INSERT
INTO DebugLog (Message) VALUES ('Done'); SET NOCOUNT OFF")
RS.Save "c:\output.xml", 1
Set RS = Nothing
objConn.Close
Set objConn = Nothing

When executed (once) there will be three 'Done' messages in the table named
DebugLog. This does not occur when the (exetremly simplified) SQL is
executed directly inside SQL Server, or when RS.Save is not called. This
looks like a bug in ADO to me.

Can anybody confirm this behaviour and more importantly suggest a
solution/workaround?


Thanks
Julian


.



Relevant Pages

  • Connect SQL database through ASP
    ... I have SQL Server 2000 installed on my machine and tried ... to develop asp script to connect to the server database ... Set objConn = Server.CreateObject ... Set objRS = Server.CreateObject ...
    (microsoft.public.sqlserver.connect)
  • Re: FOR XML AUTO - Cutting off XML
    ... > I'm using Classic ASP with SQL Server to read in XML data. ... > If I return about 5 records everything seems fine but returning 10 records,> the XML seems to cut off towards the end. ... > Set objConn = Server.CreateObject ... > Set objRS = Server.CreateObject> objRS.Open strSQL, ...
    (microsoft.public.sqlserver.programming)
  • Lookup executes 3 time upon Recordset.Save
    ... executed three times (tested on SQL Server 2000 and 2005 using both sqloledb ... and drivers): ... Set objConn = Server.CreateObject ... INTO DebugLog VALUES; ...
    (microsoft.public.data.ado)
  • connect to sql server
    ... I can connect to my database with everything but my ASP page. ... SQL Server does not exist or access denied" ... the connection string is: ... Set objconn = Server.CreateObject ...
    (microsoft.public.sqlserver.programming)
  • Re: ODBC Drivers
    ... Sql server is not there and that's the one I need. ... that from an installer for SQL Server, or from MDAC 2.8 SP1, unless you're ... Note that you can get ODBC drivers from many sources besides Microsoft. ... those data sources. ...
    (microsoft.public.data.odbc)