Solved

AODB.Recordset -> objRS.AddNew problem

Posted on 2000-03-24
3
411 Views
Last Modified: 2012-08-14
Here's my cute little test.asp file:

<!-- #include file="includes/adovbs.inc" -->

<%
 
      Set rs = Server.CreateObject("ADODB.Recordset")

      strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/imc/database/herbalife.mdb")
      rs.Open "test", strDSN, adOpenStatic ',adLockBatchOptimistic
      rs.AddNew
        rs("test") = "yapp: " & Now
      rs.UpdateBatch
      rs.Close
      Set rs = Nothing

%>


And here is the error I allways get:

ERROR :

ADODB.Recordset error 800a0cb3

The operation requested by the application is not supported by the provider.

/learning/ecm/test.asp, line 10

---------

what on earth am I doing wrong?

I just want to be able to add a new record via the .addnew metode..

"HEEELP!"

thanks in advance,
NiTech
0
Comment
Question by:NiTech
3 Comments
 
LVL 4

Accepted Solution

by:
FRehman earned 50 total points
ID: 2654401
dont use updatrebatch method use update method for saving the record i think you not familar with vb dont worry i correct the code

set Myconn=server.CreateObject("ADODB.connection")
Myconn.Open "DRIVER={MicroSoft Access Driver (*.mdb)};DBQ=" & server.MapPath("./website.mdb")
set rs=server.CreateObject("ADODB.recordset")
rs.open "Select * from Login " ,Myconn ,adOpenDynamic,adLockOptimistic
rs.AddNew
rs.Fields("usrName")=loginName
rs.Fields("pwd")=pwd
rs.Update
rs.close
0
 
LVL 1

Expert Comment

by:bennyliaw
ID: 2654424
Do you really need apostrof ' in the line below?!

rs.Open "test", strDSN, adOpenStatic ',adLockBatchOptimistic

I think it makes the server use default value that is adLockReadOnly which will not allow you to modify the recordset.

Try using adLockBatchOptimistic or adLockOptimistic instead
0
 

Author Comment

by:NiTech
ID: 2656330
That's mighty good.
And, mmm I am familiar with vb, I was just very confused by different explainations. So instead of getting further confused I choose to find a correct answer - Now()

Thanks in advance
Nit-
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to update a dummy recordset with classic ASP 4 87
Update table value with join syntax 2 70
Bypass cross origin issues on development site 3 77
Select case on click 3 16
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question