Solved

ADO runtime error 3265

Posted on 2000-02-20
3
762 Views
Last Modified: 2013-12-25
Greetings to all!  I just recently migrated from DAO to ADO using jet provider, and I am having problems with the generation of an autonumber column.  I keep on receiving runtime error 3265 everytime the program would process "col.Properties("AutoIncrement") = True".  A partial list of the code is listed below:

      Dim cat As ADOX.Catalog
      Dim tbl As ADOX.Table
      Dim col As ADOX.Column
      Dim key As ADOX.key
         
      On Error Resume Next
      Kill "c:\groomercdr\liloan.mdb"
      On Error GoTo 0

      ' Create a new database in 3.5 format (Access 97)
      Set cat = New ADOX.Catalog
      cat.Create "Provider=Microsoft.Jet.OLEDB.3.51;" & _
                       "Data Source=c:\groomercdr\liloan.mdb;"

      ' Create a new Table
      Set tbl = New ADOX.Table
      tbl.Name = "TYPE_J_CDR"
      cat.Tables.Append tbl

      ' Create a new autonumber ID Column
      Set col = New ADOX.Column
      col.Name = "TypeJ_ID"
      col.Type = adInteger
      col.ParentCatalog = cat
      col.Properties("AutoIncrement") = True       'source of my headache :-)
      cat.Tables("TYPE_J_CDR").Columns.Append col

      ' Create a new Primary Key for the table
      Set key = New ADOX.key
      key.Name = "PrimaryKey"
      key.Type = adKeyPrimary
      key.Columns.Append "TypeJ_ID"
      cat.Tables("TYPE_J_CDR").Keys.Append key

Also note that I have referenced already, ADO 2.1 library and ADO Ext. 2.1 for DDL and Security.  What is wrong with my code?  I need help urgently.  Thank you.
0
Comment
Question by:Alfred1
  • 2
3 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 100 total points
ID: 2539647
Change your provider like this:

FROM:
cat.Create "Provider=Microsoft.Jet.OLEDB.3.51;" & _
"Data Source=c:\groomercdr\liloan.mdb;"

TO:
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\groomercdr\liloan.mdb;"

This feature isn't supported under version 3.51 and ADOX!
0
 
LVL 21

Author Comment

by:Alfred1
ID: 2540155
For: emoreau

I have just downloaded and upgraded my data access components to MDAC 2.5.  I tried the Jet 4.0 provider, and it works perfectly in my code!  Thank you very much.

As a final comment, I noticed that the performance of ADO in generating a 150,000 call data records needs almost twice the time against using DAO.  But based on write-ups, it is said that the structure of ADO is flatter than DAO.  Why is it that it performs slower than DAO when using a jet provider?

Anyway, thank you again and more power to you!
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2540162
DAO has the same structure as Jet. So DAO can use the Access database natively.

ADO is more general and have to use an extra layer that DAO didn't.

Even with this, I still consider ADO to be a good choice.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question