×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Trouble opening database Make sure the drive is available

Trouble opening database Make sure the drive is available

Trouble opening database Make sure the drive is available

(OP)
Hi,

I have an issue with my MS Access application.
When I start the application it gives an error
"Trouble opening database {Database File Path}
Make sure the drive is available.
Error: Not a valid password (3031)
"

even the password is correct.
I have tried opening the database with the same password it gets opened without error.
But when I open it through Frontend application it gives the above error.
If anybody has a solution to it please help.
I use it in MS Windows 10 Pro version with MS Access 2007 runtime.

Thanks in advance.

RE: Trouble opening database Make sure the drive is available

Access 2007 Runtime?

Try Access runtime 2013 or higher...

Just a hunch but there was a 32 vs 64 bit issue with Access 2010 which may be effecting the file.

Beyond that I would suggest various trouble shooting things involving the full version of Access.

Like compact and repair.
Removing the password.
Import everything to a fresh file.

Good luck!

RE: Trouble opening database Make sure the drive is available

(OP)
Thanks for the reply.

I have sorted out this issue.
There was some code I have added few days back which runs while database connection because user complains for the slow speed of application.
It was creating this issue.

Below is the code for the reference.

Sub OpenAllDatabases(pfInit As Boolean)
' Open a handle to all databases and keep it open during the entire time the application runs.
' Params : pfInit TRUE to initialize (call when application starts)
' FALSE to close (call when application ends)
' Source : Total Visual SourceBook

Dim x As Integer
Dim strName As String
Dim strMsg As String

' Maximum number of back end databases to link
Const cintMaxDatabases As Integer = 2

' List of databases kept in a static array so we can close them later
Static dbsOpen() As DAO.Database

If pfInit Then
ReDim dbsOpen(1 To cintMaxDatabases)
For x = 1 To cintMaxDatabases
' Specify your back end databases
Select Case x
Case 1:
strName = gDatabasePath & gDatabaseName
Case 2:
strName = gDatabasePath & gDatabaseName
End Select
strMsg = ""

On Error Resume Next
Set dbsOpen(x) = OpenDatabase(strName)
If Err.Number > 0 Then
strMsg = "Trouble opening database: " & strName & vbCrLf & _
"Make sure the drive is available." & vbCrLf & _
"Error: " & Err.Description & " (" & Err.Number & ")"

End If

On Error GoTo 0
If strMsg <> "" Then
MsgBox strMsg
Exit For
End If
Next x
Else
On Error Resume Next
For x = 1 To cintMaxDatabases
dbsOpen(x).Close
Next x
End If
End Sub

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close