M
Microsoft News Server
Using VB.NET
I have the path to my Access file stored in an App.config file:
<add key="constring" value="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Data/METL.mdb;Persist Security Info=False"/>
I usually set the connection like this:
'* Get the appSettings constring value (set in the web.config)
strConstring =
System.Configuration.ConfigurationSettings.AppSettings("constring")
'* Connects to database
ocnConnection = New OleDb.OleDbConnection(strConstring)
After creating an Excel file and saving it to a folder other than the
application folder, my database connections always try to find the database
file in the folder the Excel file was saved to.
If dlgSaveFile.ShowDialog() = DialogResult.OK Then
Excel.DisplayAlerts = False
Excel.AlertBeforeOverwriting = False
Excel.ActiveWorkbook.SaveAs(dlgSaveFile.FileName)
Excel.ActiveWorkbook.Close()
Else
Excel.ActiveWorkbook.Close(False)
End If
Thanks,
Sacha
I have the path to my Access file stored in an App.config file:
<add key="constring" value="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Data/METL.mdb;Persist Security Info=False"/>
I usually set the connection like this:
'* Get the appSettings constring value (set in the web.config)
strConstring =
System.Configuration.ConfigurationSettings.AppSettings("constring")
'* Connects to database
ocnConnection = New OleDb.OleDbConnection(strConstring)
After creating an Excel file and saving it to a folder other than the
application folder, my database connections always try to find the database
file in the folder the Excel file was saved to.
If dlgSaveFile.ShowDialog() = DialogResult.OK Then
Excel.DisplayAlerts = False
Excel.AlertBeforeOverwriting = False
Excel.ActiveWorkbook.SaveAs(dlgSaveFile.FileName)
Excel.ActiveWorkbook.Close()
Else
Excel.ActiveWorkbook.Close(False)
End If
Thanks,
Sacha