Problems Connecting To An Access Database

Hello All,

I am having some problems connecting to an Access Database and I have NO idea what could be wrong with my connection string. Would someone be kind enough to explain what is going on here please The database is an Access 2003 Database saved in Access 2000 format. I am using the connection builder to help format my connection string correctly. It is a secure database using an MDW file called Accounting.mdw. I can log on to the database from Access with my user ID and password just fine, no problem. I have included my code and the connection string built by the connection builder. The error I receive is "Could Not Find Installable ISAM"

This is the connection string:

Provider=Microsoft.Jet.OLEDB.4.0;

Password=sf49ers;

User ID=vscurtis;

Jet OLEDB:System Database=D:\Projects\ApplicationFramework\ApplicationFramework\bin\Debug\Database\Accounting.mdw;

DataSource=D:\Projects\ApplicationFramework\ApplicationFramework\bin\Debug\Database\Accounting.mdb"

This is my code:

Public Function OpenDB() As Boolean

Dim strConnection As String

strConnection = InitDB()

Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor

CurrentDatabase.ConnectionString = strConnection

CurrentDatabase.Open()

Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default

OpenDB = True

End Function

Private Function InitDB() As String

Dim bldConn As New OleDb.OleDbConnectionStringBuilder

bldConn.Item("Provider") = "Microsoft.Jet.OLEDB.4.0"

bldConn.Item("DataSource") = Parent.DatabasePath

bldConn.Item("Jet OLEDB:System Database") = Parent.SecurityPath

bldConn.Item("User ID") = Parent.User.Name

bldConn.Item("Password") = Parent.User.Password

'bldConn.Item("Jet OLEDB:Engine Type") = 0

InitDB = bldConn.ConnectionString

End Function



Answer this question

Problems Connecting To An Access Database

  • aagheda

    hi.

    Is your problem solved

    Thank you,
    Bhanu.



  • Rodrigo Tom Back

    A quick search with Google yielded this:

    I was able to get rid of the ISAM error message by
    adding the following to the end of the connection statement. (Mode=Share
    Deny None).

    Doing a search on your error message may help you find the answer you need. I have never used the Connection Stringbuilder so, I cannot offer you a better solution than this one. I do hope it helps.

    james

    aka:Trucker


  • sridhar236

    you better make connection first with wizard, then copy the provided connection string in the connection made through wizard and paste that connection string to your code ....

    it might work fine!!!



  • Problems Connecting To An Access Database