Results 1 to 2 of 2

Thread: Please Help!

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    3
    Hi,

    I have just started off with ADO, Database programming and I am already facing a problem I cant seem to solve.

    Here is the code I have written:


    Dim db As New ADODB.Connection
    db.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\Inetpub\Wwwroot\Tutorial\guestbook.mdb;"
    Dim rec As New ADODB.Recordset
    rec.Open "Guest", db
    rec.AddNew


    The problem is that the 'rec.AddNew' statement gives the following error.

    "The operation requested by the application is not supported by the provider"

    ASP scripts that Insert data to a database dont work either.
    But reading from a database works just fine.

    [ Please help me solve this problem.I have spent about 3 days breaking my head over it. :-( ]

    Thanx. :-)

    Abid

  2. #2
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Try something along the lines of

    Code:
      Set rs = New adodb.Recordset
    
      rs.CursorType = adOpenKeyset
      rs.LockType = adLockOptimistic
      rs.Open "Guest", db, , , adCmdTable
    
      rs.AddNew
    I may be wrong but I think if you don't specify how to open the recordset it defaults to foward only, which does not allow updates.

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