Solved

ADO runtime error 3265

Posted on 2000-02-20
3
763 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

830 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