Addnew Method of ADO does not work.

Results 1 to 3 of 3

Thread: Addnew Method of ADO does not work.

  1. #1
    Vipul Desai Guest

    Default Addnew Method of ADO does not work.

    I need to add records to an Access Table and I am having an error that states that the Provider does not support this method immediately after the "RS.addnew" command. My code is below and could someone please help. It is urgent!<BR><BR>&#060;%@EnableSessionState=True Language=VBScript%&#062; <BR>&#060;HTML&#062;<BR>&#060;BODY bgColor=CLAY&#062;<BR><BR>Dim ADOConn<BR>Dim Daoconn<BR>Dim rs <BR><BR><BR>dim count<BR>Set ADOCOnn = CreateObject("Adodb.Connection") <BR>Set RS = CreateObject("ADODB.REcordSEt") &#039<BR>AdoConn.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=c est.MDB" <BR><BR>RS.Open "collapsed",adoConn,adOpenDynamic<BR><BR><BR>RS.Ad dNew<BR>rs("field1") = "my Value" <BR>rs.update<BR>&#039Response.Err Description &#039Program Crashes Here.<BR>&#039Provider does not support this method.<BR><BR><BR><BR><BR><BR>End Sub<BR>%&#062;<BR>&#060;p&#062;<BR>&#060;/HEAD&#062;<BR>&#060;/BODY&#062; <BR>&#060;/HTML&#062; <BR><BR>--------------------------------------------------------------------------------<BR> <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Addnew Method of ADO does not work.

    try including file

  3. #3
    Join Date
    Dec 1969

    Default RE: Addnew Method of ADO does not work.

    I have used the following code innumerable times and it has always worked<BR><BR>if not isempty(RS) then set RS=nothing<BR>set RS=server.createobject("ADODB.Recordset")<BR> tiveconnection=Application("DBOBJ") &#039 the app level object<BR>RS.cursortype=1<BR>RS.LockType =3<BR>RS.Source = "select * from someTable where SomeCondition"<BR><BR>RS.addnew<BR>RS.field s("somefield")=somevariable<BR>RS.fields("anotherf ield")=anothervariable<BR>RS.fields("yetanotherfie ld")=yetanothervariable<BR>RS.Update<BR>set RS=nothing<BR><BR><BR>there is no reason why it should not work for you too.<BR><BR>Happy Programming

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts