A
Anthony
I have a database that is on a server. The users have to connect to the
server with a userID and password before they can use it. However, since we
have laptops, we can either be connected to the network or out in the field
not connected. When we go out in the field, there is a function built into
the database that loads your data onto your harddrive so you can use the
database off-line. When you log onto the database I have this code:
Private Sub cmd_Login_Click()
On Error GoTo Code_Err
DoCmd.Hourglass True
Dim db As New ADODB.Connection
int_Connected = 1
Me.lbl_Connection.Visible = True
db.ConnectionString = Get_DBConn()
db.Open
..(Code that checks your password and userID)
..
..
Resume_Login:
Dim db_Database As DAO.Database
Dim rst_Checked_In As DAO.Recordset
Dim str_sql As String
Set db_Database = CurrentDb
str_sql = "SELECT Project_ID, Checked_In, Security_ID FROM
sys_Checked_In"
Set rst_Checked_In = db_Database.OpenRecordset(str_sql)
(Code that checks your password and UserID and determine if you have a
project checked out)
..
..
Code_Err:
If Err.Number = "-2147467259" Then
MsgBox "You do not have access to the live database at this time.
You will only be able to make changes to the project you have checked out."
int_Connected = 0
GoTo Resume_Login
Else
MsgBox Err.Description, , "#" & Err.Number
End If
Resume Code_Exit
If it tries to connect but can't find the server, ADO issues an error code
"-2147467259". As you can see from my code near the bottom, If that error
is detected, it suppose to issue a message then goto "Resume_Login". For
some reason, that is not working. Instead, the error code "-2147467259" is
displayed on the screen, and the program bombs out saying to can't find the
server.
Any help would be appreciated.
server with a userID and password before they can use it. However, since we
have laptops, we can either be connected to the network or out in the field
not connected. When we go out in the field, there is a function built into
the database that loads your data onto your harddrive so you can use the
database off-line. When you log onto the database I have this code:
Private Sub cmd_Login_Click()
On Error GoTo Code_Err
DoCmd.Hourglass True
Dim db As New ADODB.Connection
int_Connected = 1
Me.lbl_Connection.Visible = True
db.ConnectionString = Get_DBConn()
db.Open
..(Code that checks your password and userID)
..
..
Resume_Login:
Dim db_Database As DAO.Database
Dim rst_Checked_In As DAO.Recordset
Dim str_sql As String
Set db_Database = CurrentDb
str_sql = "SELECT Project_ID, Checked_In, Security_ID FROM
sys_Checked_In"
Set rst_Checked_In = db_Database.OpenRecordset(str_sql)
(Code that checks your password and UserID and determine if you have a
project checked out)
..
..
Code_Err:
If Err.Number = "-2147467259" Then
MsgBox "You do not have access to the live database at this time.
You will only be able to make changes to the project you have checked out."
int_Connected = 0
GoTo Resume_Login
Else
MsgBox Err.Description, , "#" & Err.Number
End If
Resume Code_Exit
If it tries to connect but can't find the server, ADO issues an error code
"-2147467259". As you can see from my code near the bottom, If that error
is detected, it suppose to issue a message then goto "Resume_Login". For
some reason, that is not working. Instead, the error code "-2147467259" is
displayed on the screen, and the program bombs out saying to can't find the
server.
Any help would be appreciated.