Rachael2211
Member
- Local time
- Today, 13:40
- Joined
- Oct 24, 2013
- Messages
- 33
Hi All and thanks for taking a look at my problem!
Situation: MS server 2008, access 2010 frontend and 2003 backend on this. Users logon onto server through a remote desktop connection where they can open the .accdr loaded there, so all users have there own rdp logon but are using the same .accdr
Problem: One area of the program creates a temp table (using a make table query) when the form is opened to display some complex data, it's only display, no manipulation. The make table query is based on a union query pulling info from all over. The problem occurs when another user tries to enter this same area and the program tries to run the make table. The error message states that the tempo table is locked by another user - I get all that and why the error is occurring - so - my thought was to test if the temp table was in use and bypass the make table.
Here's what I've tried:
Public Function IsTableOpen(strName As String) As Boolean
IsTableOpen = SysCmd(acSysCmdGetObjectState, acTable, strName)
End Function
'on open proc of form
If IsTableOpen("BusBud1Temp") Then
MsgBox "Table in Use"
Else
DoCmd.OpenQuery "BusBud1Qry_MT"
End If
and...
Dim db As DAO.Database
Dim rs2 As DAO.Recordset
Set db = CurrentDb()
Set rs2 = db.OpenRecordset("BusBud1Temp", dbOpenTable, dbDenyWrite + dbDenyRead)
If Err.Number > 0 Then
MsgBox "Table in Use"
Else
rs2.Close
Set rs2 = Nothing
DoCmd.OpenQuery "BusBud1Qry_MT"
End If
So I think the above fails because each user is sharing the frontend file ie they both have the .accdr open in their own remote desktop session.
I did think of putting the temp files in the backend but not sure if this is good practice as I don't want them to bloat it, it's already quite large.
Any ideas or suggestions will be most welcome, thank you.
Kind regards, Rachael
Situation: MS server 2008, access 2010 frontend and 2003 backend on this. Users logon onto server through a remote desktop connection where they can open the .accdr loaded there, so all users have there own rdp logon but are using the same .accdr
Problem: One area of the program creates a temp table (using a make table query) when the form is opened to display some complex data, it's only display, no manipulation. The make table query is based on a union query pulling info from all over. The problem occurs when another user tries to enter this same area and the program tries to run the make table. The error message states that the tempo table is locked by another user - I get all that and why the error is occurring - so - my thought was to test if the temp table was in use and bypass the make table.
Here's what I've tried:
Public Function IsTableOpen(strName As String) As Boolean
IsTableOpen = SysCmd(acSysCmdGetObjectState, acTable, strName)
End Function
'on open proc of form
If IsTableOpen("BusBud1Temp") Then
MsgBox "Table in Use"
Else
DoCmd.OpenQuery "BusBud1Qry_MT"
End If
and...
Dim db As DAO.Database
Dim rs2 As DAO.Recordset
Set db = CurrentDb()
Set rs2 = db.OpenRecordset("BusBud1Temp", dbOpenTable, dbDenyWrite + dbDenyRead)
If Err.Number > 0 Then
MsgBox "Table in Use"
Else
rs2.Close
Set rs2 = Nothing
DoCmd.OpenQuery "BusBud1Qry_MT"
End If
So I think the above fails because each user is sharing the frontend file ie they both have the .accdr open in their own remote desktop session.
I did think of putting the temp files in the backend but not sure if this is good practice as I don't want them to bloat it, it's already quite large.
Any ideas or suggestions will be most welcome, thank you.
Kind regards, Rachael