By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

Example code to create an MS Access db locally using VB.Net 2003

P: n/a
Hi,

I am a beginner looking for example code on how to create an access
database for a local application. I need to create the database when
the app is first installed. I can do it with SQL 2000 but I am not
sure how to do create a db, tables and fields as a local mdb. Any help
or pointers to where I can find example code on this much appreciated.

Thanks
John
Jul 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi John,

See
ACC: Create and Drop Tables and Relationships Using SQL DDL
http://support.microsoft.com/default...45&Product=acc
and
HOWTO: Common DDL SQL for the Microsoft Access Database Engine
http://support.microsoft.com/default...41&Product=acc

It is not directly related to ado.net.
You will have to execute those ddl commands via
OleDbCommand.ExecuteNonQuery() method.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"John" <jo**@hokykoky.com> wrote in message
news:5a**************************@posting.google.c om...
Hi,

I am a beginner looking for example code on how to create an access
database for a local application. I need to create the database when
the app is first installed. I can do it with SQL 2000 but I am not
sure how to do create a db, tables and fields as a local mdb. Any help
or pointers to where I can find example code on this much appreciated.

Thanks
John

Jul 21 '05 #2

P: n/a
Cor
Hi John,

set a reference to COM adox ext 2.x for dll and security
\\\
Dim catNewDB As New ADOX.Catalog
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0; " & "Data
Source=C:\db1.mdb")
///
I hope this helps a little bit?

Cor
I am a beginner looking for example code on how to create an access
database for a local application. I need to create the database when
the app is first installed. I can do it with SQL 2000 but I am not
sure how to do create a db, tables and fields as a local mdb. Any help
or pointers to where I can find example code on this much appreciated.

Jul 21 '05 #3

P: n/a
Thanks for this guys, I will give it a try and see what happens.
Regards
John
"Cor" <no*@non.com> wrote in message news:<#R**************@TK2MSFTNGP10.phx.gbl>...
Hi John,

set a reference to COM adox ext 2.x for dll and security
\\\
Dim catNewDB As New ADOX.Catalog
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0; " & "Data
Source=C:\db1.mdb")
///
I hope this helps a little bit?

Cor
I am a beginner looking for example code on how to create an access
database for a local application. I need to create the database when
the app is first installed. I can do it with SQL 2000 but I am not
sure how to do create a db, tables and fields as a local mdb. Any help
or pointers to where I can find example code on this much appreciated.

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.