Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple-step OLE DB operation generated errors

Status
Not open for further replies.

mackey333

Technical User
May 10, 2001
563
0
0
US
I am trying to convert my asp page to use the command.execute function instead of resultset.open to interface with a database. I am totally lost as to why this works:

Code:
For Each issue In issues
                
                value = trim(issue)
                
                addIssue = "INSERT INTO issues(issue_number, visit_number, description) VALUES (" + issue + "," + cstr(int(visitNum) + 1) + ",'" + Request.QueryString("issue" + issue) + "');"
                
                ObjRs.Open addIssue, ObjConn
                
            Next

but this doesn't

Code:
For Each issue In issues
                
                value = trim(issue)
                
                addIssue = "INSERT INTO issues(issue_number, visit_number, description) VALUES (?,?,?);"
                
                ObjCmd.CommandText = addIssue
                ObjCmd.Execute , Array(int(issue), int(visitNum) + 1, cstr(Request.QueryString("issue" + issue)))
                
            Next

The second code produces this error:

Microsoft OLE DB Provider for SQL Server error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

The table is set up as follows:

issue_number int
visit_number int
description varchar(100)


Any thoughts?

-Greg :-Q

flaga.gif
 
Hi Greg

Why do you have a comma following Execute?
I generally just create an ADODB connection and run the sql on the fly... ie.

set con=createobject("ADODB.Connection")
con.open "YOUR_CONN_STRING"
strSQL="INSERT INTO issues(issue_number, visit_number, description) VALUES (?,?,?)"
con.execute(strSQL)
con.close
set con=nothing

Try running like this first....

sugarflux
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top