Re: create access tables in C# at runtime

From: Stephen Howe (stephenPOINThoweATtns-globalPOINTcom)
Date: 12/30/04


Date: Thu, 30 Dec 2004 17:46:08 -0000


> I found how to create a database in
> http://support.microsoft.com/kb/317881/EN-US/
>
> But how to create tables with fields, indexes and so at runtime? Some
> examples are very welcome...

Those examples exist under Microsofts MSDN documentation on ADOX.

See here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/admscadoapireference.asp

for ADOX overview

and here

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/admscadoxcodeexamplesvc.asp

for C++ examples (none for C# that I have found but you should be able to
adapt or translate).

The Create Method, Indexes Append Method and Primary Key properties should
be of interest to you. They all work on the example NorthWind database so
you should be able to modify and test them out.

Stephen Howe



Relevant Pages

  • Re: creating a database subset in vba
    ... There is no way in ADOX to do things like setting the DisplayControl of the ... That's why I say you have to use both ADOX and DAO ... in my database copy have the columns rearranged. ... stripped out blank template in far less time than I have already spent ...
    (microsoft.public.access.modulesdaovba)
  • Re: Error 3265 mystery error
    ... I'm not using ADOX in the app. ... I did check the database window in MS Access, ... Have you dynamically created tblTest (you mentioning of ADOX in your OP ... "tblTest" to some other table in the database, it opens fine. ...
    (microsoft.public.data.ado)
  • Re: creating a database subset in vba
    ... I did spend some time playing with ADOX to copy the structure ... in my database copy have the columns rearranged. ... stripped out blank template in far less time than I have already spent ... all the proerties right with just DDL, so copying the file will be much ...
    (microsoft.public.access.modulesdaovba)
  • Re: refreshing linked tables: NO DAO
    ... we use ADOX to relink password database at a specific location. ... setting property for password "Jet OLEDB:Link Provider String". ... Dim objFECatalog As ADOX.Catalog ...
    (microsoft.public.access.modulesdaovba)
  • Re: Linking tables via ADO?
    ... Properties for user-level security on an ADOX Table object, ... syntax that works just fine for an ADO Connection object, ... to connect to an Access database with ADO after it has been secured with ... See http://www.QBuilt.com for all your database needs. ...
    (microsoft.public.access.tablesdbdesign)