Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ADO runtime error 3265

Posted on 2000-02-20
3
Medium Priority
?
769 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.
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

885 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