Open AZDeveloper777 opened 1 year ago
@AZDeveloper777 - Gracefully handling the error from a missing drive should be pretty simple... The other question about skipping certain objects is a bit more involved. That being said, I think it is a very legitimate scenario where a development machine may not have access to all of the network resources required for a full export.
Of course we could just handle the error and move on, but some connections like remote SQL tables might take several seconds to time out, causing a significant delay on every export operation. For cases like this I could see the value of having a way to exclude certain objects, but only on certain machines. We wouldn't want to save this in vcs-options.json
, since that is replicated to each development computer, but I could see this as being saved to a .env
file that is specific to that one machine, and not checked into version control.
I recently implemented .env
support as a part of #415 and this might be a good use case for implementing a way to exclude certain objects. Initially I am thinking of a line Exclude=
and set the value to a JSON array of objects. My hesitation is that requiring users to hand-edit JSON arrays could be asking for trouble. We could add some UI elements for selecting objects for exclusion, but that's a bit of work to put something like that together for a rarely-needed feature...
Open to suggestions... 😄
I think skipping linked tables that aren't ODBC and aren't available would be a good compromise. I'm pretty sure that my error handling for Err.Number = 68 accomplishes that since an ODBC table shouldn't generate that number if it isn't available.
Discussed in https://github.com/joyfullservice/msaccess-vcs-addin/discussions/416
Here is my fix.
Private Sub IDbComponent_Export(Optional strAlternatePath As String)
On Error GoTo IDbComponent_Export_Error 'Get the export file name strFile = Nz2(strAlternatePath, IDbComponent_SourceFile)
IDbComponent_Export_Exit: Exit Sub
IDbComponent_Export_Error: If Err.Number = 68 Then 'Drive not available GoTo IDbComponent_Export_Exit Else Resume Next End If End Sub