Re: ConnectionWrite WrapperWriteOOB Error - Urgent



P.Nishanthan wrote:
Hi Can anybody help on this.

We have a asp file that should delete all the records in a table for
an operation.
See the code below.

Dim Rs
Dim sql
Set Rs = CreateObject("ADODB.Recordset")
sql= "SELECT * FROM Table1;"
Rs.Open sql, connUsers,2,3

do while not Rs.eof
Rs.delete
Rs.movenext
loop
Rs.Close
Set Rs = Nothing

But this fails randomly with the following message:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionWrite
(WrapperWriteOOB()).
/stools/woms/importtotbl.asp, line 63

line 63 is : Rs.delete

I tried 'connUsers.execute "DELETE FROM Table1"' also. It also fails
with same message. Please help.

1. Stop using ODBC. Please tell us the type and version of the database you
are using whenever asking a database-related question. Based on the error
message, I see you are using SQL Server, but the correct connection string
depends on the version of sql server you are using. See
www.connectionstrings.com and pick the relevant OLE DB connection string (it
will have either SQLOLEDB or SQLNACL depending on the version)

2. I am shocked that 'connUsers.execute "DELETE FROM Table1"' was your
second choice. Never use a recordset to do what can be done via a single set
operation. I can offer an improvement:

connUsers.execute "TRUNCATE TABLE Table1",,129
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: update table with the word Null
    ... not run a sql statement in a database on its own. ... specifically from an ADO Command object. ... Dim sql ... 'comment out the above line when finished debugging ...
    (microsoft.public.scripting.vbscript)
  • Re: Storing calculated values... Exception!
    ... Dim sql As String ... sql = "SELECT ssDate, ssExpectedDate, ssCompletion, ssAlgorithm ... I am looking to store some calculated values (don't flame just yet, ...
    (comp.databases.ms-access)
  • Re: Find record RunSQL in a crosstab query
    ... the results displayed in the typical query result ... Dim SQL As String ... Remember, though, that all this will do, though, is display the results. ... >>> Dim SQL As String ...
    (microsoft.public.access.formscoding)
  • Re: Import Access records to excel (parameter is a called funct)
    ... It querys alright but does not roll back ... > Dim SQL As String ...
    (microsoft.public.excel.programming)
  • RE: ExecuteNonQuery Wierdness
    ... Public Sub Write(ByVal sensor As Integer, ByVal eventId As Integer, ... ByVal eventValue As String) ... Dim sql As String ...
    (microsoft.public.dotnet.languages.vb)