Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,095 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,829 people online right now. Registration is fast and FREE... Join Now!




cannot connect to database

 
Reply to this topicStart new topic

cannot connect to database

Jakala
7 Jun, 2008 - 01:05 AM
Post #1

New D.I.C Head
*

Joined: 27 Mar, 2007
Posts: 12


My Contributions
hi I'm an beginning programmer and i'm making an programe to put personal data into an database but I don't get an connection with my database I'm working with visual studio 2005

the visual basic debugger gifs an error at the place of the arrow

CODE
Dim cn As New OleDbConnection
        Dim ConnectieString As String = _
        System.Configuration.ConfigurationSettings.AppSettings.Item("ConnectionString")
        cn.ConnectionString = ConnectieString
       ==> cn.Open()
        'Voor deze connectie een comand object aanmaken en aanduiden welke ik wens
        Dim command As OleDbCommand
        command = cn.CreateCommand


in my app.config file
CODE

<appSettings>
<add key="ConnectionString"
          value="Provider=Microsoft.Jet.OLEDB.4.0 Data Source=D:\Mijn Documenten\Visual Studio 2005\Projects\inschrijvingen welpen\inschrijvingen welpen\welpen.mdb"/>
  </appSettings>



this is the error :"The 'Microsoft.Jet.OLEDB.4.0 Data Source=D:\Mijn Documenten\Visual Studio 2005\Projects\inschrijvingen welpen\inschrijvingen welpen\welpen.mdb' provider is not registered on the local machine."

the link to the database is ok

could someone help me?

greetz

This post has been edited by Jakala: 7 Jun, 2008 - 01:08 AM
User is offlineProfile CardPM
+Quote Post

krazzy4
RE: Cannot Connect To Database
7 Jun, 2008 - 01:32 AM
Post #2

New D.I.C Head
*

Joined: 1 May, 2008
Posts: 39



Thanked: 1 times
My Contributions
Is it neccesary to get a connection string connected with app config do the simple connectivity of database
User is offlineProfile CardPM
+Quote Post

krazzy4
RE: Cannot Connect To Database
7 Jun, 2008 - 01:48 AM
Post #3

New D.I.C Head
*

Joined: 1 May, 2008
Posts: 39



Thanked: 1 times
My Contributions

Also, you might want to check out ConnectionStrings.com for a better connection string than the one you're using

User is offlineProfile CardPM
+Quote Post

Jayman
RE: Cannot Connect To Database
7 Jun, 2008 - 07:36 AM
Post #4

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,319



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Your connection string needs to be in this format.

CODE
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=;Password=;

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 12:13AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month