Results 1 to 5 of 5

Thread: DAO to ADO conversion problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    NY
    Posts
    1

    Question

    I have a program that was using DAO to add records to an Access .mdb File. I just changed it to use ADO to add records to the the same file and I'm getting an error message 'Run-time error 3251 'The operation requested by the application is not supported by the provider'.

    The operation is rs.AddNew the provider is Microsoft.Jet.OLEDB.4.0' and the reference library is the 'MS ActiveX Data Objects 2.1'.

    I was using 'MS DAO 3.51 object library'. I think the app is still referencing the old DAO obj lib. Has anybody ever seen or heard of this problem before. If you have I could use a solution.
    THANKS!!!!!

    ps: I downloaded and installed the vb6 runtime files...
    and still get the same error.

  2. #2
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Worldwide in the Sun
    Posts
    566
    You need VB6 SP4 and MS DAO 3.6 object library.

    I use this with mdb's created in access 2000.

    cheers
    Ray




    Ray

  3. #3
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    If you think your project is still referencing the DAO object library, there is a possibility that you still have the DAO object library included in the references to your project. Go to Project > Preferences and uncheck the Microsoft DAO 3.51 Object Library from the window.

    The problem arises because the DAO and the ADO use the same object naming terminology. A recordset is called a Recordset in both DAO and ADO.

    If you still want to reference both the libraries sothat you can completely test the code and then migrate totally to ADO, you can put the word 'ADODB' before any ADO data objects you are using. For e.g.

    [code]
    Dim rsDAO As RecordSet ' Declares a DAO Recordset Object Reference

    Dim rsADO As ADODB.RecordSet 'Declares a DAO Recordset Object Reference

    [\code]


    Whenever you are using ADO objects, prefix their types with "ADODB."


    I think that should take care of your problem. If you are still getting the same error, you need to check the ADO code being used, as ADO is a little more complicated to understand and program than DAO.
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  4. #4
    New Member
    Join Date
    Nov 2000
    Location
    Dublin, Ireland
    Posts
    10

    Cool

    [QUOTE]Originally posted by biskitboy0
    [B]I have a program that was using DAO to add records to an Access .mdb File. I just changed it to use ADO to add records to the the same file and I'm getting an error message 'Run-time error 3251 'The operation requested by the application is not supported by the provider'.
    The operation is rs.AddNew the provider is Microsoft.Jet.OLEDB.4.0' and the reference library is the 'MS ActiveX Data Objects 2.1'.

    You have used code for Dao /i think/

    rs.addnew
    rs.field("Field1") = "something"
    ////////////
    rs.update

    for ADO use it:
    rs.addnew
    rs.field("Field1").VALUE = "something"
    ^^^^^^^^
    ////////////
    rs.update
    s.e.a

  5. #5
    Hyperactive Member
    Join Date
    Jun 1999
    Posts
    308
    Hi there.

    DAO and ADO uses different methods to open recordset. Check Help. There may be other differences as well. Why did you switch libraries?

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