Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi everyone I have a small problem with my database creation.

 

I am trying to create a database in a direcotry as specified by the user, but I want to title the database myself.

 

So I have the following code:

 

       Dim database As String
       database = TextBox1.Text & "\mydb.mdb"

       Dim cat As Catalog = New Catalog

       cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & (database) & "Jet OLEDB:Engine Type=5")

       cat = Nothing

 

problem is that it names the database "mydb.mdbJet OLEDB".

 

I can see how and why it is doing this but I can not rectify how to stop it.

 

Any help appreciated.

 

Thanks

 

Chris

-----------------

It�s always funny until someone gets hurt� Then it become hilarious!

Posted
Just guessing but shouldn't it be something like

cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & (database) & ";Jet OLEDB:Engine Type=5")

note the extra semi-colon after the filename.

 

 

Darn it! Your right, I must have overlooked that little blighter.

 

Thanks for your help

 

c

-----------------

It�s always funny until someone gets hurt� Then it become hilarious!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...