Solved

AODB.Recordset -> objRS.AddNew problem

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server Web Traffic Limitations 4 67
Auto Submit on dropdown box 3 79
is this a cms? 8 67
Executing a script on a timer online 5 20
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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