Solved

AODB.Recordset -> objRS.AddNew problem

Posted on 2000-03-24
3
415 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 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