PC Review


Reply
Thread Tools Rate Thread

What Class is Used to Create a New Database?

 
 
=?Utf-8?B?UmljaCBT?=
Guest
Posts: n/a
 
      22nd May 2004
Hello

What class do I use if I want to write a new database file for use with OleDB? I would like this to be a Jet database file that is compatible with MS Access

It looks like I can't execute any SQL statements without a valid connection, but it doesn't look like I can make a connection to a database file that doesn't yet exist

Thank you very much
Rich
 
Reply With Quote
 
 
 
 
Mythran
Guest
Posts: n/a
 
      22nd May 2004

"Rich S" <(E-Mail Removed)> wrote in message
news179D21C-9D80-4CB2-920C-(E-Mail Removed)...
> Hello,
>
> What class do I use if I want to write a new database file for use with

OleDB? I would like this to be a Jet database file that is compatible with MS
Access.
>
> It looks like I can't execute any SQL statements without a valid

connection, but it doesn't look like I can make a connection to a database file
that doesn't yet exist!
>
> Thank you very much,
> Rich


I haven't tried it myself, but you may want to look at OleDb connections for text
files and create the text file yourself....if you have to, programmatically
create a text file that will be used for comma delimited or such

Mythran


 
Reply With Quote
 
=?Utf-8?B?UmljaA==?=
Guest
Posts: n/a
 
      22nd May 2004
Mythran

Thank you for your response. I'm looking to create a new .MDB file, which is a Jet database file

Rich.
 
Reply With Quote
 
Joe Fallon
Guest
Posts: n/a
 
      22nd May 2004
You can do it but you have to use the ADOX library.
There are plenty of code sampes so Google for Jet, .Net and ADOX and create
database.

The code works, but you have to use COM interop.
If you need to distribute the app and you don't want to be bothered with the
creation, you can always ship an empty copy of the .mdb file and copy it to
be the real file whenever you need to "create" one.
--
Joe Fallon
Access MVP



"Rich" <(E-Mail Removed)> wrote in message
news:CCD651AE-B8B8-40CD-8CBC-(E-Mail Removed)...
> Mythran,
>
> Thank you for your response. I'm looking to create a new .MDB file,

which is a Jet database file.
>
> Rich.



 
Reply With Quote
 
George Shubin
Guest
Posts: n/a
 
      22nd May 2004
Try: http://www.smithvoice.com/dbcopier.aspx

Use this program to point at an Access MDB file, and it will create all the
code necessary to recreate the database from within a VB.Net program.

Regards.


--
------------------------------------------------------------------------
George Shubin Custom Software Development
dX Software Systems Database Applications
Ph: 503-981-6806 Fax: 503-982-0120
www.dxonline.com (E-Mail Removed)
------------------------------------------------------------------------

"Rich S" <(E-Mail Removed)> wrote in message
news179D21C-9D80-4CB2-920C-(E-Mail Removed)...
> Hello,
>
> What class do I use if I want to write a new database file for use

with OleDB? I would like this to be a Jet database file that is compatible
with MS Access.
>
> It looks like I can't execute any SQL statements without a valid

connection, but it doesn't look like I can make a connection to a database
file that doesn't yet exist!
>
> Thank you very much,
> Rich



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      22nd May 2004
Hi Rich,

There is no dotNet class, however you can try this it is very simple to
create a empty mdb file.
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assume I create a class Customer is it advice to have a separate class to store addresses Tony Johansson Microsoft C# .NET 6 25th Jan 2011 01:56 AM
How do I create partial class to be nested under the main class file? Joseph Geretz Microsoft C# .NET 2 29th Mar 2007 04:42 AM
How to have New() in a Base Class create and return an instance of a Derived Class? Joe HM Microsoft VB .NET 4 22nd Nov 2005 10:31 PM
Create Object from database stored class name John Hughes Microsoft C# .NET 2 20th Sep 2005 03:50 PM
Activator could not create a instance of the class as the Length of the class name is 36 characters Jack Wright Microsoft C# .NET 0 18th Mar 2004 05:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:48 PM.