Still having trouble editing a recordset

Results 1 to 4 of 4

Thread: Still having trouble editing a recordset

  1. #1
    Ben Roy Guest

    Default Still having trouble editing a recordset

    I posted this before:<BR><BR>I am having trouble trying to update a recordset. The examples I&#039ve looked at are pretty straight forward. Here&#039s what I&#039ve got:<BR><BR>&#060;%<BR>set rs = Server.CreateObject("ADODB.Recordset")<BR>sql = "SELECT fieldnames FROM tablenames WHERE criteria"<BR> sql, "DSN=dsnname"<BR>%&#062;<BR><BR>Then if I try something like:<BR><BR>&#060;%<BR>rs("fieldname1") = "data"<BR>%&#062;<BR><BR>I get the following error:<BR><BR>ADODB.Field error &#039 800a0cb3&#039 <BR><BR>The operation requested by the application is not supported by the provider. <BR><BR><BR>This is an access database. Any thoughts? I&#039ve also tried this by opening an ADODB.Connection and then creating the recordset off of that. I&#039m hoping I&#039m just overlooking something stupid. Thanks for any suggestions.<BR><BR>Per the suggestion I received I tried using a DSN-less connection. However, I still get the same error when I try to edit one of the fields.

  2. #2
    Join Date
    Dec 1969

    Default RE: Still having trouble editing a recordset

    Have you tried a simple INSERT statement? The new data will over-write the old data.

  3. #3
    awai Guest

    Default RE: Still having trouble editing a recordset

    You&#039re opening the Recordset as read only by not specifying a lock type in your Open() call. Try:<BR> sql, "DSN=dsnname", , 3<BR>which is the same as <BR> sql, "DSN=dsnname", , adLockOptimistic<BR><BR>The ADO documentation explains the various lock types.

  4. #4
    Ben Roy Guest

    Default Woohoo

    Thanks a bunch that was the problem. I figured it was something like that, but the books I&#039ve got didn&#039t have that in their examples. That&#039s what was throwing me off. Now that I look at it I think they were setting the lock type parameter in the connection properties, then opening the recordset from the connection. I had played around with lock types a little but hadn&#039t quite got it right. Thanks again.

Posting Permissions

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