PDA

Click to See Complete Forum and Search --> : DAO to ADO conversion problem


biskitboy0
Nov 11th, 2000, 05:09 PM
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.

marex
Nov 12th, 2000, 04:22 AM
You need VB6 SP4 and MS DAO 3.6 object library.

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

cheers
Ray

honeybee
Nov 12th, 2000, 10:06 AM
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.

StarE
Nov 12th, 2000, 11:06 PM
[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

LG
Nov 13th, 2000, 03:30 PM
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?