Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ADO runtime error 3265

Posted on 2000-02-20
3
Medium Priority
?
767 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:Alfred A.
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 400 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:Alfred A.
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

704 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