Advertisement

06.09.2008 at 06:55AM PDT, ID: 23469017
[x]
Attachment Details

Access database and VB.NET program error: The Microsoft Jet database engine cannot open the file

Asked by mms_master in Microsoft Access Database, Microsoft Visual Basic.Net

Tags: vb, .net, access, microsoft, database, permission

Hi,

Sorry if this is long winded, but im trying to give you as much detail as possible, so that you understand the problem better.

I have designed a database in access to use with my VB.NET program. The database is stored in a shared folder on one of our servers. Each client pc maps this share as an X drive when a user logs on. The location of the database from any machine which has the X drive mapping is: X:\data\DNMC.dnm

I have 2 programs which use this database. The first is the client, which is installed on a selection of computers (200) at the moment for testing. The plan was then to install it on the whole network (roughly 450 machines) once it works with no errors. The client logs any errors in the following location X:\Error Logs\. The logs are saved as text files (1 per machine). The file name is the name of the PC which generated it. The log tells me which function/sub the error occured in, the form it occured in, the user logged in at the time, the time, the version of my client installed and the error message.

The client runs when a user logs in, it connects to the database, checks for certain information, then disconnects. It then repeats this every 15 minutes until the user logs out.

The second program is for inserting data to the database. It is only installed on one machine (curently, but may go on a few more eventualy, prob no more than 5) This program is opened as needed, and does not stay connected to the database at all times.

I am getting the following error log from the clients. There is no pattern to the machines it is happening on, or the users that are logged in. (Note: I have removed the usernames)

======================================================================
Error occured in (Form): frmMain
Error occured in (Sub/Function): CheckForNewMessages
Date & Time: 03/06/2008 09:54:55
Client Version: 1.0.1.2
Current User: *************
Error Message: The Microsoft Jet database engine cannot open the file ''.  It is already opened exclusively by another user, or you need permission to view its data.
======================================================================

The part that says " cannot open file ' ' " never seems to have a file name. This error doesn't occur every time. The program is able to connect to the database most of the time. For example, today this error has only occured once. Last friday it occured 11 times on 8 different machines. The "data" folder is hidden, so users are not able to see it in order to open it themselves. So it cant be that someone has the database open. The database is also password protected.

I have attached the sub which the error occurs in below.

Thanks in advance
mms_masterStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
Private Sub CheckForNewMessages()
 
        Try
            
            'If the database connection is not open
            If DBConn.State <> ConnectionState.Open Then
                'Connect to the database
                DBConn.Open()
            End If
 
            'Change the system tray icon to show that the client is checking for messages
            niSysTrayIcon.Icon = My.Resources.Receiving
 
            Dim i As Integer
            Dim DisplayFlag As Boolean = True
 
            For i = 0 To SQLQueries.Count - 1
 
                'Run an SQL command
                DBCmd = New OleDbCommand(SQLQueries.Item(i), DBConn)
                DBReader = DBCmd.ExecuteReader
 
                While DBReader.Read()
 
                    Dim j As Integer
                    DisplayFlag = True
                    For j = 0 To myStructs.ReceivedMessages.Count - 1
 
                        If DBReader("tblMessages.ID") = myStructs.ReceivedMessages.Item(j).ID Then
 
                            Dim tempDate1 As DateTime = DBReader("TimeSent")
                            Dim tempDate2 As DateTime = myStructs.ReceivedMessages.Item(j).DateTime
 
                            If tempDate1.Date = tempDate2.Date Then
                                If tempDate1.TimeOfDay = tempDate2.TimeOfDay Then
                                    DisplayFlag = False
                                End If
                            End If
 
                        End If
 
                    Next
 
                    'If the message hasnt been received yet, display it, otherwise dont
                    If DisplayFlag = True Then
                        DisplayMessage(DBReader("FilterType"), DBReader("Filter"), DBReader("Forename") & " " & DBReader("Surname") & " (" & DBReader("Description") & ")", DBReader("TimeSent"), DBReader("Message"), DBReader("MsgBoxType"))
                        myStructs.AddNewMessage(DBReader("tblMessages.ID"), DBReader("TimeSent"))
                    End If
 
                End While
 
            Next
 
            If DBConn.State <> ConnectionState.Closed Then
                DBConn.Close()
            End If
 
            'Change the system tray icon to show that the client is has finished checking for messages
            niSysTrayIcon.Icon = My.Resources.Online
 
            'Start the next check timer
            tmrNextCheck.Start()
 
        Catch ex As Exception
            'MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.ApplicationModal)
            modErrorLogging.LogError(ex.Message, Me.Name, "CheckForNewMessages")
 
            If DBConn.State <> ConnectionState.Closed Then
                DBConn.Close()
            End If
 
            'Start the next check timer
            tmrNextCheck.Start()
        End Try
 
    End Sub
[+][-]06.09.2008 at 01:34PM PDT, ID: 21746423

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2008 at 03:57AM PDT, ID: 21749950

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 04:22AM PDT, ID: 21882513

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 05:24AM PDT, ID: 21882862

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.27.2008 at 05:36AM PDT, ID: 21882949

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Access Database, Microsoft Visual Basic.Net
Tags: vb, .net, access, microsoft, database, permission
Sign Up Now!
Solution Provided By: jimpen
Participating Experts: 5
Solution Grade: A
 
 
[+][-]06.27.2008 at 05:45AM PDT, ID: 21883025

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 05:55AM PDT, ID: 21883113

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 06:35AM PDT, ID: 21883465

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 06:41AM PDT, ID: 21883527

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.27.2008 at 07:47AM PDT, ID: 21884336

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 09:04PM PDT, ID: 21889206

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.02.2008 at 02:22AM PDT, ID: 21914612

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 05:09AM PDT, ID: 21915420

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906