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 strongm 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.

ASmee

IS-IT--Management
Jul 9, 2002
46
US
Getting the following error message:

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

How do I investigate this, I can't work out the line that is causing the problem?
 
You trying to update some records?
You are using the something like
rs.AddNew,rs.Update?

________
George, M
 
I am using:

rs.addnew
rs.fields("field") = variable
 
I've had same problem long time ago when i first started to use rs.AddNew.
You should check if you have rs.Update after the rs("..")=value lines.
If not would help if you post code here.

________
George, M
 
The section of code:

test = request.form("Bike")
midtest = mid(test,instr(test," ")+1,len(test))
strSQL = "select model.model_id from model where model = '" & midtest & "'"

rsAddComments.open strSQL, adoCon


model_dets = rsAddComments("model_id")
rsAddComments.Close

test_tyre = request.form("Tyres")
tyre_mid = mid(test_tyre,instr(test_tyre," ")+1,len(test_tyre))


strSQL = "select tyre_model.tyre_model_id from tyre_model where tyre_model.model = '" & tyre_mid & "'"
response.write(strSQL)

rsAddComments.open strSQL, adoCon

tyre_dets = rsAddComments("tyre_model_id")
rsAddComments.Close

Set rsAddComments = Nothing
Set adoCon = Nothing



Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.MDB)}; DBQ=" & Server.MapPath("bike.mdb")
Set rsAddComments = Server.CreateObject("ADODB.Recordset")

strSQL = "select details_ratings.rider_id, details_ratings.model_id, details_ratings.handling, details_ratings.suspension, details_ratings.tyres, details_ratings.fuel_con, details_ratings.looks, details_ratings.reliability, details_ratings.colour, details_ratings.n_or_s, details_ratings.cost, details_ratings.age, details_ratings.alarm_make, details_ratings.datatagged, details_ratings.tyre_model_id from details_ratings"

rsAddComments.CursorType = 2
rsAddComments.LockType = 3

rsAddComments.open strSQL, adoCon

rsAddComments.AddNew

rsAddComments.Fields("rider_id") = id
rsAddComments.Fields("model_id") = model_dets
rsAddComments.Fields("handling") = request.form("handling")
rsAddComments.Fields("suspension") = request.form("suspension")
rsAddComments.Fields("tyres") = request.form("tyre_rate")
rsAddComments.Fields("fuel_con") = request.form("fuel_consumption")
rsAddComments.Fields("looks") = request.form("looks")
rsAddComments.Fields("reliability") = request.form("reliability")
rsAddComments.Fields("colour") = request.form("colour")
rsAddComments.Fields("n_or_s") = request.form("n_or_s")
rsAddComments.Fields("cost") = request.form("cost")
rsAddComments.Fields("age") = request.form("age")
rsAddComments.Fields("Alarm_make") = request.form("alarm_make")
rsAddComments.Fields("Datatagged") = request.form("datatagged")
rsAddComments.Fields("tyre_model_id") = tyre_dets


Set rsAddComments = Nothing
Set adoCon = Nothing
 
Try to use

rsAddComments.open strSQL, adoCon, 3, 3 instead of

rsAddComments.CursorType = 2
rsAddComments.LockType = 3

and dont forget to
rsAddComments.Update at the end



________
George, M
 
Tried that, the problem persists. Is there anyway to investigate what the errors are?
 
You should try to execute this simple code
Code:
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.MDB)}; DBQ=" & Server.MapPath("bike.mdb")
Set rsAddComments = Server.CreateObject("ADODB.Recordset")

strSQL = "select top 1 * from details_ratings"

rsAddComments.open strSQL, adoCon,3,3

rsAddComments.AddNew

rsAddComments.Fields("rider_id") = id
rsAddComments.Fields("model_id") = model_dets
rsAddComments.Fields("handling") = request.form("handling")
rsAddComments.Fields("suspension") = request.form("suspension")
rsAddComments.Fields("tyres") = request.form("tyre_rate")
rsAddComments.Fields("fuel_con") = request.form("fuel_consumption")
rsAddComments.Fields("looks") = request.form("looks")
rsAddComments.Fields("reliability") = request.form("reliability")
rsAddComments.Fields("colour") = request.form("colour")
rsAddComments.Fields("n_or_s") = request.form("n_or_s")
rsAddComments.Fields("cost") = request.form("cost")
rsAddComments.Fields("age") = request.form("age")
rsAddComments.Fields("Alarm_make") = request.form("alarm_make")
rsAddComments.Fields("Datatagged") = request.form("datatagged")
rsAddComments.Fields("tyre_model_id") = tyre_dets

rsAddComments.Update
Set rsAddComments = Nothing
Set adoCon = Nothing


________
George, M
 
Unfortunately I still get the same message.
 
I have four text fields, ranging from 4 to 50 in size, the rest are number ranging from byte to long interger.
 
Hrmm try to check the string size of the fields, maybe they are longer then the actual fields size.


________
George, M
 
interestingly if I hardcode all the numbers as 4 and all text as A the update goes through! I suspect the issue lies with request.form, somewhere, I will play further. Thanks.
 
I usualy use text with 255 max chars and numbers as long int. Text fields are treated like varchars in SQL.

________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top