Click here to Skip to main content
16,005,826 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Print at the center Pin
terence20043-Mar-04 13:53
terence20043-Mar-04 13:53 
GeneralRe: Print at the center Pin
Dave Kreskowiak3-Mar-04 18:14
mveDave Kreskowiak3-Mar-04 18:14 
GeneralSet assignment not supported Pin
Reed Eichner2-Mar-04 19:28
Reed Eichner2-Mar-04 19:28 
GeneralRe: Set assignment not supported Pin
Dave Kreskowiak3-Mar-04 1:32
mveDave Kreskowiak3-Mar-04 1:32 
GeneralCreating Access Database using Code Pin
vister722-Mar-04 10:18
vister722-Mar-04 10:18 
GeneralRe: Creating Access Database using Code Pin
Mike Ellison2-Mar-04 13:51
Mike Ellison2-Mar-04 13:51 
GeneralRe: Creating Access Database using Code Pin
vister722-Mar-04 14:01
vister722-Mar-04 14:01 
GeneralRe: Creating Access Database using Code Pin
Mike Ellison3-Mar-04 6:21
Mike Ellison3-Mar-04 6:21 
Hi Vi. You know, most beginners start with "Hello World" instead of "Create Access Database from Scratch" Big Grin | :-D

One way to accomplish what you're describing is through the ADOX library. Here's a link to MSDN documentation introducing ADOX:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/admscadoxfundamentals.asp[^]

In a nutshell, the ADOX Catalog object's Create() method will let you create the .mdb file. Then you can use a standard ADO.NET OleDbConnection object to connect to the new database file, and an ADO.NET OleDbCommand object to execute sql statements against the connection. Using OleDbCommand's ExecuteNonQuery() method will let you issue statements like "Create Table xxx ..." to create your tables. Alternatively, you could use ADOX's Table object to accomplish the same task.

ADOX is a COM library, not a .NET library, meaning that you have to use Interop techniques to use the ADOX objects in your .NET code. This isn't difficult, and there are many articles available on the subject of COM Interop. This article shows an example of using Visual Studio to make the proper references to the COM ADOX library:

http://www.tek-tips.com/gfaqs.cfm/lev2/4/lev3/32/pid/796/fid/3888[^]

This article (right here on CodeProject) goes more in depth into the concept of Interop. Its fairly long, but toward the bottom are ADOX examples that are directly relevant to the task you're working on -

http://codeproject.com/books/186100558x_16.asp[^]

I hope this gives you something you can work with.
--mike
GeneralRe: Creating Access Database using Code Pin
vister723-Mar-04 7:29
vister723-Mar-04 7:29 
GeneralMFC help!!! Pin
modeonetwo2-Mar-04 8:59
modeonetwo2-Mar-04 8:59 
QuestionHow to create a wizard for my Application? Pin
Ritesh Sompura2-Mar-04 7:07
Ritesh Sompura2-Mar-04 7:07 
GeneralWriting a file to disk Pin
Pugman8122-Mar-04 6:53
Pugman8122-Mar-04 6:53 
GeneralRe: Writing a file to disk Pin
Dave Kreskowiak2-Mar-04 7:46
mveDave Kreskowiak2-Mar-04 7:46 
GeneralChanging tab focus before event fired Pin
Steven D Parker2-Mar-04 2:57
sussSteven D Parker2-Mar-04 2:57 
Generalwww.DNNCS.com for sale Pin
Anonymous2-Mar-04 0:04
Anonymous2-Mar-04 0:04 
GeneralNokia Infrared (8210 ,8310) or Siemens Pin
CamboMedia1-Mar-04 17:54
CamboMedia1-Mar-04 17:54 
General(nulls) display problem in datagrid new row Pin
Danny van der Walt1-Mar-04 9:34
Danny van der Walt1-Mar-04 9:34 
GeneralRe: (nulls) display problem in datagrid new row Pin
gpa20001-Mar-04 20:03
gpa20001-Mar-04 20:03 
GeneralContext Menu Pin
KEITHSTER1-Mar-04 7:57
KEITHSTER1-Mar-04 7:57 
GeneralRe: Context Menu Pin
yangchengmin1-Mar-04 18:43
yangchengmin1-Mar-04 18:43 
Generalabsolute memory access Pin
Allan P. Krings1-Mar-04 4:08
Allan P. Krings1-Mar-04 4:08 
Generalcan't modify property in property window Pin
scott987uk1-Mar-04 3:24
scott987uk1-Mar-04 3:24 
GeneralRe: can't modify property in property window Pin
Dave Kreskowiak1-Mar-04 6:28
mveDave Kreskowiak1-Mar-04 6:28 
GeneralHelp Document Pin
Manimee1-Mar-04 0:37
Manimee1-Mar-04 0:37 
QuestionHow can I capture the New Mail Event Handle? Pin
KiranGrover29-Feb-04 23:51
KiranGrover29-Feb-04 23:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.