473,499 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
3 3006
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4512
by: Mark Lees | last post by:
Just installed 2003 and the help file sucks because it tries to connect to Microsoft Online Help which takes too long. When I run Access and I'm not connected to the internet, it seems to connect...
0
2165
by: Mick Hardy | last post by:
Hi, Has anyone seen this weird behaviour or have any suggestions or can anyone reproduce it? The history: I converted a large third party DB from 97 to XP and it uses the...
47
4480
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small...
0
1303
by: BucRepus | last post by:
I have two XP boxes with 'identical' installs (NO IIS on either). I log in locally with same username with same permissions on each box. I connect to Win2003 Entp Server. I try to create a new...
5
1370
by: dw | last post by:
Hello, all. We are trying to create an ASP.NET project on our Windows 2003 server via Visual Studio 2003 on a workstation via the network. We keep getting the following error: "The Web server...
1
1193
by: Andy | last post by:
We have an ASP.NET application exported from MS Access 2003. I uses a series of queries to generate a page showing todays bookings. It works locally but does not work when we put it on a...
5
450
by: John | last post by:
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...
6
2310
by: cj | last post by:
Lets just take this example I'm looking at now. I'm looking at the help screen titled .NET Framework Class Library FolderBrowserDialog Class . It gives an example at the bottom that begins with:...
3
2388
by: purkka | last post by:
Hi I replaced a Win 2000 Adv server to the Win 2003 Std with Front Page Server Extension and .Net Framework 2.0. FPSE is extended to Default Web Site. Visual Studio 2005: If I create a new web...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7225
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.