I have a front end database called ACCOUNTS.
I have a back end database called MINI
The MINI database contains several thousand tables. For this example I would like to use table 1250.
Thus I would like to establish the best way to bring the data from table 1250 in the backend into a form in my front end ACCOUNTS database.
I do not want to create a linked table and so have been looking at DAO and AOD connections.
The main requirements are as follows:
1. That the rear end database is not locked up by accessing data for the front end form
2. That the data sent is read only and can not be manipluated by the user of the front end.
(Does a snapshot recordset match the above requirements?)
I have been trying to solve this for several days, but get confused by the differnet options.
I would very much apprecaite help.
The code I have cobbled togther so far works on the on open event, but fails on the on close event (i don't know why).
Is the code any good overall and is there a better way????
Sincere thanks Mark
Private Sub Form_Open(Cancel As Integer)
Dim wrkJet As Workspace
Dim dbsmini As DAO.Database
Dim rstmini As DAO.Recordset
'Create Microsoft Jet Workspace object.
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
'Open Database object from saved Microsoft Jet database
Set dbsmini = wrkJet.OpenDatabase("C:\mini.mdb", False, True)
Set rstmini = dbsmini.OpenRecordset("1250", dbOpenSnapshot)
Set Me.Recordset = rstmini
Me![Txtdate].ControlSource = "Date"
End Sub
Private Sub Form_Close()
wrkJet.Close
rstmini.Close
Set rstmini = Nothing
End Sub
I have a back end database called MINI
The MINI database contains several thousand tables. For this example I would like to use table 1250.
Thus I would like to establish the best way to bring the data from table 1250 in the backend into a form in my front end ACCOUNTS database.
I do not want to create a linked table and so have been looking at DAO and AOD connections.
The main requirements are as follows:
1. That the rear end database is not locked up by accessing data for the front end form
2. That the data sent is read only and can not be manipluated by the user of the front end.
(Does a snapshot recordset match the above requirements?)
I have been trying to solve this for several days, but get confused by the differnet options.
I would very much apprecaite help.
The code I have cobbled togther so far works on the on open event, but fails on the on close event (i don't know why).
Is the code any good overall and is there a better way????
Sincere thanks Mark
Private Sub Form_Open(Cancel As Integer)
Dim wrkJet As Workspace
Dim dbsmini As DAO.Database
Dim rstmini As DAO.Recordset
'Create Microsoft Jet Workspace object.
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
'Open Database object from saved Microsoft Jet database
Set dbsmini = wrkJet.OpenDatabase("C:\mini.mdb", False, True)
Set rstmini = dbsmini.OpenRecordset("1250", dbOpenSnapshot)
Set Me.Recordset = rstmini
Me![Txtdate].ControlSource = "Date"
End Sub
Private Sub Form_Close()
wrkJet.Close
rstmini.Close
Set rstmini = Nothing
End Sub