Creating Database from scratch using OLEDB?

Troy

Well-known member
Joined
Feb 7, 2005
Messages
153
Programming Experience
10+
ok guess I tried using DAO to create a database but my references are so old they won't convert to 2005. The majority of my program is written using OLEDB so perhaps you can help me grasp how to create a new Database using it.

I just need a basic example I can figure it out from a basic example.

I need to create to tables in this One is basic information the other is information based off of the first table. the common field is "CustomerID"

which is the primary Key for the first table and automatically generated and unique.

I created my first DB with Access and have my program manipulating it well. But I need for it to be able to construct a totally new DB without using access.

Any help is appreciated, lol hard to believe I've done this once 10 years ago. But now everything is so different it's learning all over again.

:confused:
 
I Really liked this link and I appreciate the Response I can use it and create an Access DB just like I wanted but I don't understand how to add tables, keys and associations to the DB. If anyone has a few more examples I'd appreciated it.
 
Hi,

To create table etc:
VB.NET:
[COLOR=blue][COLOR=blue]Private[/COLOR] [COLOR=blue]Sub[/COLOR] CreateOleDbCommand([COLOR=blue]ByVal[/COLOR] queryString [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR], [COLOR=blue]ByVal[/COLOR] connectionString [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR])    [/COLOR]
[COLOR=blue]     Using connection [COLOR=blue]As[/COLOR] [COLOR=blue]New[/COLOR] OleDbConnection(connectionString)        [/COLOR]
[COLOR=blue]        connection.Open()        [/COLOR]
[COLOR=blue]        [COLOR=blue]Dim[/COLOR] command [COLOR=blue]As[/COLOR] [COLOR=blue]New[/COLOR] OleDbCommand(queryString, connection)        [/COLOR]
[COLOR=blue]        command.ExecuteNonQuery()    [/COLOR]
[COLOR=blue]     [COLOR=blue]End[/COLOR] Using[/COLOR]
[COLOR=blue][COLOR=blue]End[/COLOR] [COLOR=blue]Sub[/COLOR][/COLOR]

The following link will have some example statements for "queryString" to create table, index and etc.
http://support.microsoft.com/default.aspx?scid=kb;en-us;180841
 
Back
Top