Solved

AODB.Recordset -> objRS.AddNew problem

Posted on 2000-03-24
3
414 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
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/…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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