Garren.Shannon
Member
- Local time
- Today, 06:23
- Joined
- Sep 22, 2022
- Messages
- 113
Hey all,
I have a transportation ridership database I have been building for months now. I am getting to the end. The last part is a stand-alone version for trip entry. I test to see if I am on the network before running DSNLess connection code. When I am attached to the network, everything works as expected. But when I put the Surface Go in airplane mode (simulating being out of network range) Access crashes as it tries to load/connect the linked tables.
The program will run without the linked tables so I am wondering if I should be deleting the links if the user is not on the network. Below is the DSNLess connection code I run. All user activity reads and writes to local copies of the tables and simply don't need the linked tables. the only time the linked tables come into play is when the user is On-Line and ready to upload records to the master SQL DB.
If the network is not available, I think I should be deleting the linked tables right?
I have a transportation ridership database I have been building for months now. I am getting to the end. The last part is a stand-alone version for trip entry. I test to see if I am on the network before running DSNLess connection code. When I am attached to the network, everything works as expected. But when I put the Surface Go in airplane mode (simulating being out of network range) Access crashes as it tries to load/connect the linked tables.
The program will run without the linked tables so I am wondering if I should be deleting the links if the user is not on the network. Below is the DSNLess connection code I run. All user activity reads and writes to local copies of the tables and simply don't need the linked tables. the only time the linked tables come into play is when the user is On-Line and ready to upload records to the master SQL DB.
If the network is not available, I think I should be deleting the linked tables right?
Code:
If PingOk("10.8.0.73") Then
' Connect to the central SQL database
If AttachDSNLessTable("dbo_Drivers", "dbo.Drivers", "mssql2019", "ridership", "", "") And AttachDSNLessTable("dbo_Vehicles", "dbo.Vehicles", "mssql2019", "ridership", "", "") And AttachDSNLessTable("dbo_Trip", "dbo.Trip", "mssql2019", "ridership", "", "") And AttachDSNLessTable("dbo_Trans-Type", "dbo.Trans-Type", "mssql2019", "ridership", "", "") And AttachDSNLessTable("dbo_SchoolYrDates", "dbo.SchoolYrDates", "mssql2019", "ridership", "", "") Then
MsgBox ("Connected to core database")
Else
'// Not okay.
End If
' Turn off annoying warnings and Update driver, vehicle and school year databases from SQL master tables
DoCmd.SetWarnings (False)
DoCmd.OpenQuery ("ResetVehiclesQuery")
DoCmd.OpenQuery ("AppendFromDBO_Vehicles")
DoCmd.OpenQuery ("ResetDriversQuery")
DoCmd.OpenQuery ("AppendFromDBO_Drivers")
DoCmd.OpenQuery ("ResetSchoolYrDatesQuery")
DoCmd.OpenQuery ("AppendFromDBO_SchoolYrDates")
'Turn the warnings back on
DoCmd.SetWarnings (True)
Else
MsgBox ("I can't reach the master database at this time but you can still add trips!")
End If