Results 1 to 6 of 6

Thread: ADO Addnew problems

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Chicago, IL
    Posts
    13

    Unhappy

    When trying to run the following code I get a 3251 runtime error. It says "...not supported by the provider...". I am using ADO (ActiveX Libarary 2.1).

    ----------------------------------------
    With rsName
    .addnew
    .rsName.Fields("fldFirstName").Value = txtFName
    .update
    End With
    -----------------------------------------
    the code will not go past the Addnew command. I am new to ADO, so any help would be really appreciated. Thanks

  2. #2
    Addicted Member
    Join Date
    May 2000
    Posts
    188
    Try This

    With rsName
    .addnew
    .Fields("fldFirstName").Value = txtFName
    .update
    End With

    also if this doesn't work you might want to try to upgrade to ADO version 2.5 available from Microsoft (look for MDAC_TYP.EXE version 2.5)

    If you have more problems let me know.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Chicago, IL
    Posts
    13
    I tried downloading the update...but still no luck. I had my code the way you had showed it, I had made a typo when I posted it on here.

    Any idea's?

    Here is the code again (should be correct this time)
    ----------------------------------------------------
    Set rsMiscWork = New Recordset
    rsMiscWork.Open "tblMiscWork", dbRadio

    With rsMiscWork

    .AddNew
    .Fields("fldDate").Value = txtDate.Text
    .Fields("fldSite").Value = cmbSite.Text
    .Fields("fldWork").Value = txtWork.Text
    .Update
    .Requery
    End With
    ------------------------------------------------------
    Also the error reads "Object or provider is not capable
    of performing requested operation"

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Cool check the lock type

    I sometimes both of those errors if I forget to specify the
    lock type. Try setting the lock type to Optimistic Locking
    and see if that helps.

    it would look like
    Code:
    Set rsMiscWork = New Recordset 
    rsMiscWork.Open "tblMiscWork", dbRadio, adOpenKeyset, adLockOptimistic

  5. #5
    Lively Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    88
    More information.

    When you use .open property without specifying any cursor and lock types, the default will be adOpenForwardOnly and adLockReadOnly, repectively. Therefore, if you want to update, you have to specify one of these arguments.

    Cursor Type: adOpenKeyset, adOpenDynamic, and adOpenStatic

    Lock Type: adLockPessimistic, adLockOptimistic, and adLockBatchOptimistic

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Chicago, IL
    Posts
    13

    Talking

    GOT IT!
    I set the record locking to optimistic and it started working.

    Thanks alot for all the help.

Posting Permissions

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



Click Here to Expand Forum to Full Width