How do I get configuration file to point to the correct DB file?

  • Thread starter Thread starter Al Repasky
  • Start date Start date
A

Al Repasky

The program I have written with VB/NET 2003 has a Myapp.exe.config
file that I did not know I would be creating. My program using an
Access db and can not find the DB file after building the executable.
When this config file is there it runs ok and when it is not there it
can not find the DB file. When I put the program on another computer
it can not find the DB file either way. Does anyone have an idea what
is happening?

Thanks,
Al
 
Here is what I tried and it does not work. I did not do it exactly as
you told me, but I did get the filename in the config file. I also
put in a display of the file string that it is using and it is
pointing to the correct place. It work on my development computer,
but not on the other computer. Maybe it is too old to run .NET on.
It is a Pentium 120. I did add a line manually and forgot to take it
out of the config fine. It is the add key to DataSource. I do not
think that would matter to have the extra line.

Does anyone have any more ideas how to make this work?

Thanks,
Al
-------------------------------
Here is the code it now have:

'
'DBConn
'
Me.DBConn.ConnectionString =
CType(configurationAppSettings.GetValue("DBConn.ConnectionString",
GetType(System.String)), String)
-----------------------------------------------
Here is what is in the config file:

<?xml version="1.0" encoding="Windows-1252"?>
<configuration>
<appSettings>
<!-- User application and configured property settings go
here.-->
<!-- Example: <add key="settingName" value="settingValue"/> -->
<add key="DBConn.DataSource" value="C:\Program
Files\AutoMind\AutoMind\AutoMind.mde" />
<!--StartFragment -->
<add key="DBConn.ConnectionString" value="Jet OLEDB:Global Partial
Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking
Mode=1;Data Source=&quot;C:\Program
Files\AutoMind\AutoMind\AutoMind.mde&quot;;Jet OLEDB:Engine
Type=5;Provider=&quot;Microsoft.Jet.OLEDB.4.0&quot;;Jet OLEDB:System
database=;Jet OLEDB:SFP=False;persist security info=False;Extended
Properties=;Mode=Share Deny None;Jet OLEDB:Encrypt Database=False;Jet
OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on
Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User
ID=Admin;Jet OLEDB:Global Bulk Transactions=1" />
</appSettings>
</configuration>
 
Back
Top