ADOX autoincrement field when creating database 
Author Message
 ADOX autoincrement field when creating database

I wish to have a field  autoincrement  and use a Long varaible type.

This is an example of my code to create part of the database

  Dim ADOXcatalog As New ADOX.Catalog

  ADOXcatalog.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & "c:\aaa\books.mdb"

  'bookdata table
  Dim ADOXtable1 As New Table
  ADOXtable1.Name = "BookData"

The problem code is here.
How to autoincrement and is this right type for a Long variable????
  ADOXtable1.Columns.Append "ID", adInteger, dbAutoIncrField + dbFixedField
?????????????????????????

  ADOXtable1.Columns.Append "Titles", adLongVarWChar    'memo field
  ADOXtable1.Columns.Append "Subtitle", adLongVarWChar
  ADOXtable1.Columns.Append "Author", adVarWChar, 100
  ADOXtable1.Columns.Append "Imprint", adVarWChar, 100
  ADOXtable1.Columns.Append "ISBN", adVarWChar, 100
  ADOXtable1.Columns.Append "Description", adVarWChar, 100
  ADOXtable1.Columns.Append "CallNumber", adVarWChar, 50
  ADOXtable1.Columns.Append "Accession", adVarWChar, 50
  ADOXtable1.Columns.Append "Bibliography", adVarWChar, 100
  ADOXtable1.Columns.Append "Series", adVarWChar, 100
  ADOXtable1.Columns.Append "Status", adVarWChar, 70
  ADOXtable1.Columns.Append "Barcode", adVarWChar, 50
  ADOXtable1.Columns.Append "LocalData", adVarWChar, 100
  ADOXtable1.Columns.Append "CheckoutPeriod", adVarWChar, 10
  ADOXtable1.Columns.Append "CatalogCard", adLongVarWChar
  ADOXtable1.Columns.Append "Notes", adLongVarWChar
  ADOXtable1.Columns.Append "DateTime", adDate
  ADOXtable1.Columns.Append "User", adVarWChar, 50
  ADOXtable1.Columns.Append "MarcData", adLongVarWChar
  ADOXtable1.Columns.Append "SdlsRecord", adLongVarWChar
  ADOXtable1.Columns.Append "TitleDuplicate", adVarWChar, 50
  'append tables to database
  ADOXcatalog.Tables.Append ADOXtable1
  'internal index on fields
  Dim ADOXindex1 As New ADOX.Index
  Dim ADOXindex2 As New ADOX.Index
  Dim ADOXindex3 As New ADOX.Index
  Dim ADOXindex4 As New ADOX.Index
  ADOXindex1.Name = "AuthorIndex"         'name of index
  ADOXindex1.Columns.Append "Author"      'field name to index
  ADOXindex2.Name = "BarcodeIndex"
  ADOXindex2.Columns.Append "Barcode"
  ADOXindex3.Name = "CallNumberIndex"
  ADOXindex3.Columns.Append "CallNumber"
  ADOXindex4.Name = "TitleDuplicateindex"
  ADOXindex4.Columns.Append "TitleDuplicate"
  'append indexes to table1
  ADOXtable1.Indexes.Append ADOXindex1
  ADOXtable1.Indexes.Append ADOXindex2
  ADOXtable1.Indexes.Append ADOXindex3
  ADOXtable1.Indexes.Append ADOXindex4



Wed, 24 Mar 2004 22:25:39 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ADOX and Autoincrement fields

2. ADOX AutoIncrement field

3. Default value in field of database created with ADOX

4. Creating AutoIncrement Field using code

5. Need to create random autoincrement field

6. Acess 2000, ADOX y autoincrement

7. AutoIncrement in ADOX

8. create/delete fields with Adox - catalog object

9. ADOX create fields

10. Creating new fields, need ADOX?

11. Create boolean field using ADOX

12. ADOX version 2.1 create fields

 

 
Powered by phpBB® Forum Software