Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
Go Back  Xtreme Visual Basic Talk > > > Reconnecting to MS Access 2010 Database


Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2013, 11:27 AM
SeahawkFan SeahawkFan is offline
Freshman
 
Join Date: Oct 2010
Location: Los Angeles, CA
Posts: 26
Default Reconnecting to MS Access 2010 Database


I created an application that updates and inserts records into an Access 2010 database. I originally looked for options to get this working and succeeded. The database was not password protected during testing so I could avoid dealing with constant password entries until such time I was ready to deploy. That time has now come and I want to protect the database.

I followed the instructions for password protecting Access 2010 databases, then went about trying to adjust my connection string to compensate. Here is the original connection string:

Code:
    Public Function ConnectToOdbc() As Boolean
        Dim connected As Boolean = False
        conn.ConnectionString = "FIL=MS Access;DSN=CRLDB"
        Try
            conn.Open()
            connected = True
        Catch ex As Exception
            MessageBox.Show("connection failed..." & vbCrLf & vbCrLf & ex.Message)
        End Try
        Return connected
    End Function
The ODBC is a standard Microsoft Access driver (*.mdb, *.accdb) on 32-bit, with a Windows 7 platform. The database is on a shared network drive. Again, what is written above worked without issue before password protecting.

I tried several means of getting it to connect with the password activated but to no avail. Annoyed, I decided to remove the password protection on the database and restore everything to the original configuration. Unfortunately, the program continues to fail connection to the database.

I have tried deleting and recreating the ODBC, using OLEDB connection strings per web recommendations and am at wit's end. I'm coming here with a clean slate to see if someone can help me reestablish connectivity to the password-protected database.

Further background on the project:
  • I am not doing conventional database forms through VB. Rather, it is treeviews, text fields and check boxes that get translated into INSERT INTO and UPDATE commands sent to the database through the connection
  • Server Explorer isn't used in this project
  • The application will be used by employees who will access it via Windows 7 or Windows XP platforms.
  • The current error message I receive with the connection set up as it is above is as follows:
    Quote:
    ERROR [HY000][Microsoft][ODBC Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.

Any help would be greatly appreciated!
Reply With Quote
  #2  
Old 07-31-2013, 12:26 PM
SeahawkFan SeahawkFan is offline
Freshman
 
Join Date: Oct 2010
Location: Los Angeles, CA
Posts: 26
Default

Solution found. I changed everything to OLEDB references and updated my connectionstring accordingly. Still not sure why password protecting and unprotecting would result in the ODBCConnection string failure, but this workaround is working beautifully.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
 
Reconnecting to MS Access 2010 Database
Reconnecting to MS Access 2010 Database
 
-->