Solved

ADO runtime error 3265

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

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 69

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now