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.Co nnectionString",
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="C:\Program
Files\AutoMind\AutoMind\AutoMind.mde";Jet OLEDB:Engine
Type=5;Provider="Microsoft.Jet.OLEDB.4.0" ;;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>
-----------------------------------------------------------------------------------
Rakesh Rajan <Ra*********@discussions.microsoft.com> wrote in message news:<44**********************************@microso ft.com>...
Hi Repasky,
In your scenario, it's best to save the path to your access db into a config file.
Use the app.config file to create a new section and a key which would point to the DB file. So, when you move your app to a new computer, just change the config file to edit the key value to point to the new file location.
Try this MSDN link for more info:
http://msdn.microsoft.com/library/de...onsections.asp
--
Rakesh Rajan
"Al Repasky" wrote:
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