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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error with AddNew

Status
Not open for further replies.

onpnt

Programmer
Dec 11, 2001
7,778
US
I have a interesting error to share with everyone I have not seen yet. ANyone have any ideas. Everything looks fine but this error. Here's the code.

DIM selected
selected = "SELECTED"


DIM Proc
Proc = Request.QueryString("strProc")
DIM printer
printer = Request.QueryString("strprinter")
DIM disc
disc = Request.QueryString("strdisc")
DIM opt
opt = Request.QueryString("stropt")
DIM total
total = Request.QueryString("total")
DIM mail
mail = Request.QueryString("email")

' ok now we've got our data so let's ship it off to the database
set conn = server.createobject("adodb.connection")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("orders.mdb")
Set Recordset=Server.CreateObject("ADODB.Recordset")
Recordset.Open "SELECT * FROM tblOrder",conn, 1
Recordset.AddNew
Recordset("Processor")="Proc"
Recordset("Optical")="opt"
Recordset.Update
response.write &quot;The record has been added.<p>&quot;
response.write &quot;<a href='backbutton.htm'>Back</a>&quot;

Conn.Close
set Conn=nothing provide tools to let people become their best.
 
What error?
No DIM for RecordSet?
No RecordSet.Close: Set Recordset = Nothing?
Writing literals &quot;Proc&quot; and &quot;Opt&quot; instead of variables Proc and Opt?
??? Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Lets get some things out of the way
that was pretty ignorant of me not to include the error.
Error Type:
ADODB.Recordset (0x800A0CB3)
Object or provider is not capable of performing requested operation.



No DIM?
Set Recordset=&quot;the connect&quot;
Recordset equals the SQL statement.
Not sure I've ever had to close a Recordset. Is this common? I was only aware of the Close statement being referred to the connection var.

I have figured the situation out however. The problems were on the administrative side of the database being on the server. It works fine now. Thanks for your time though. provide tools to let people become their best.
 
I'm getting this very same error... can you tell me what you did to fix the problem?
 
I got ahold of the DB administrator and gave them a earfull. This had to to with the rights being set incorrectly the server side of things. Took them five minutes to fix. No idea what they did but if you're doing the DB work as well microsoft has a good explanation of the error and corrections involved. copy and paste the error into there search and it will bring it up. Hope this helps you out. I remember this was pretty frustrating. provide tools to let people become their best.
 
I got the same error when doing an insert in the db. The code is correct.

what could be the problem??
and the solution??

thanx
 
The problem is there is no locktype specified and ADO uses a read-only lock by default.

Recordset.Open &quot;SELECT * FROM tblOrder&quot;,conn, 1, 2 Jon Hawkins
 
wow! this is a old thread.

jonscott8
I did see the read-only issue, it was a typo.[lol]
The main issue I rememeber was on the database administrators side and after she did her thing it was resolved. [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Thnx for the help guys. I did a search on the error I got and there were 2 parts to my solution BOTH covered in this therad. I had to change my rights in the database manager software, and I had to modify the locktype I was using in my SQL statement. After donig both of those, my things are working great now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top