I'm building an application where the data tables (Access) are stored in the same file as the application, my connection string reads:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=FTED.mdb;Persist Security Info=False"
I added capability to export data to Excel - it all works great EXCEPT when I use the CommonDialog box to allow the user to select where to save the file.
The directory the user selects becomes the directory where my application looks for the data files!
The app.path doesn't change. I can correct my Data Environments by re-writing the ConnectionStrings, (although it is clumsy because the Data Environments are still wrong, changing the ConnectionString doesn't change the DataSource) but I'm using a few ADODC controls that also need to be reset so they can find the data files (again).
I don't want to hardcode the path, because I don't have control over where users install.
Does anyone know where the string is located for the DataSource, and how to either 1.) prevent it from changing when I use the CommonDialog, or 2.) reset it after using the CommonDialog? As I said before, it isn't App.Path.
Any help would be appreciated!
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=FTED.mdb;Persist Security Info=False"
I added capability to export data to Excel - it all works great EXCEPT when I use the CommonDialog box to allow the user to select where to save the file.
The directory the user selects becomes the directory where my application looks for the data files!
The app.path doesn't change. I can correct my Data Environments by re-writing the ConnectionStrings, (although it is clumsy because the Data Environments are still wrong, changing the ConnectionString doesn't change the DataSource) but I'm using a few ADODC controls that also need to be reset so they can find the data files (again).
I don't want to hardcode the path, because I don't have control over where users install.
Does anyone know where the string is located for the DataSource, and how to either 1.) prevent it from changing when I use the CommonDialog, or 2.) reset it after using the CommonDialog? As I said before, it isn't App.Path.
Any help would be appreciated!