New topic: 

ADOX Auto Increment

<http://forums.realsoftware.com/viewtopic.php?t=27987>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       stoneringers           Post subject: ADOX Auto IncrementPosted: 
Mon May 11, 2009 4:48 pm                        
Joined: Wed Mar 18, 2009 5:05 am
Posts: 9              I am trying to add the Auto Increment property to an Id 
field using the code below.
I get an OLE failure on the "cat.Tables.Append tblB" statement. I am using this 
method as the ADO sql method, create table, does not allow you to add fields 
with the names "date" & "time" which I need to do.

Any suggestions greatfully recieved



  Dim cn,connectionString, fl  as string
  Dim tblB As New OLEObject("ADOX.Table") 
  Dim cat As New OLEObject("ADOX.Catalog")
  fl="C:\clients.mdb"
 
  // create new data base
  
  cat.create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fl + ";Jet 
OLEDB:Engine Type=5;"
  // first table
  tblB.Name = "NSA"
  tblB.Columns.Append "Id",3 // adInteger  
  tblB.Columns("Id").ParentCatalog = Cat
  tblB.Columns("Id").Properties("Autoincrement") = True
  cat.Tables.Append tblB
  
  exception err as OLEException
  msgbox err.message   
                            Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     

-- 
Over 900 classes with 18000 functions in one REALbasic plug-in. 
The Monkeybread Software Realbasic Plugin v8.1. 

&lt;http://www.monkeybreadsoftware.de/realbasic/plugins.shtml&gt;

[email protected]

Reply via email to