OleDbException was unhandled. Could not use "checkin.mdb". File already in use...
Need help on how to avoid this error message.
The database i am using is an MS Access 2003 mdb file. I develop the system in VS 2010 with 6 users for this database. every time the second user open's the system it debugs directly and pop ups this message "OleDbException was unhandled. Could not user "checkin.mdb". file is in use by user 'Admin'.
I am new to vb.net and still trying my best to dry run the system i develop until i found this error with multiple users.
thank you in advance for your help regarding this problem.
Below is the code that debugs every time i load the form.
 
	
		
			
		
		
	
				
			Need help on how to avoid this error message.
The database i am using is an MS Access 2003 mdb file. I develop the system in VS 2010 with 6 users for this database. every time the second user open's the system it debugs directly and pop ups this message "OleDbException was unhandled. Could not user "checkin.mdb". file is in use by user 'Admin'.
I am new to vb.net and still trying my best to dry run the system i develop until i found this error with multiple users.
thank you in advance for your help regarding this problem.
Below is the code that debugs every time i load the form.
Private Function GetQueueNum()
    'Get last queuingNum
        Dim newNum As Integer = 0
        ' Execute the SQL Statement
        Dim qCon As OleDb.OleDbConnection = New OleDb.OleDbConnection()
        qCon.ConnectionString = GetConnString()
[I][B]        qCon.Open() ------------------------------------------------------------->> OleDBException was unhandled[/B][/I]
        'grab the queueing number from counter table
        Dim sqlTop = ("SELECT * FROM Top1CheckIn;")
        Dim sqlCmd As New Data.OleDb.OleDbCommand(sqlTop, qCon)
        Dim dr As Data.OleDb.OleDbDataReader = sqlCmd.ExecuteReader()
        Try
            If dr.HasRows Then
                While dr.Read()
                    newNum = dr("QueueingNum").ToString
                    lblNextQNum.Text = CStr(Format(newNum, "000"))
                    txtCheckInID.Text = dr("CheckInID").ToString
                    lblNextQNum.Refresh()
                End While
                Return True
            Else
                lblNextQNum.Text = " "
                txtCheckInID.Text = 0
                lblNextQNum.Refresh()
                Return False
            End If
        Catch ex As Exception
            Return False
        End Try
   qCon.Close()
End Function
			
				Last edited by a moderator: 
			
		
	
								
								
									
	
		
			
		
		
	
	
	
		
			
		
		
	
								
							
							 
	 
 
		 atabase Password=;"
atabase Password=;" 
 
		 
 
		