A
Al Repasky
I have written a VB.NET 2003 program that accesses a Access DB. On my
development PC it works fine. I created a setup program so that I can
install this on other computers. Of source, I have to install the
..NET framework first. But when I run the program on the other PC it
does not find the DB, even when it displays the correct file string.
Here is what I tried and it does not work. Maybe it is too old to run
..NET on.
It is a Pentium 120.
Does anyone have any more ideas how to make this work?
Thanks,
Al
-------------------------------
Here is the code it now has:
'
'DBConn
'
Me.DBConn.ConnectionString =
CType(configurationAppSettings.GetValue("DBConn.ConnectionString",
GetType(System.String)), String)
----------------------------------
Here is the code that does not find the file:
Dim str As String
Dim int As Integer
Dim Adapt1 As OleDb.OleDbDataAdapter
'Create SQL Statement
str = "SELECT tYear FROM tAutos GROUP BY tYear ORDER BY tYear"
'Load table
Adapt1 = New OleDb.OleDbDataAdapter(str, DBConn)
Try
DBConn.Open()
Catch
MessageBox.Show("Database file can not be found.")
MessageBox.Show(DBConn.DataSource)
Application.Exit()
End Try
-----------------------------------------------
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"/> -->
<!--StartFragment -->
<add key="DBConn.ConnectionString" value="Jet OLEDB:Global Partial
Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDBatabase 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 OLEDBon't Copy Locale on
Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User
ID=Admin;Jet OLEDB:Global Bulk Transactions=1" />
</appSettings>
</configuration>
development PC it works fine. I created a setup program so that I can
install this on other computers. Of source, I have to install the
..NET framework first. But when I run the program on the other PC it
does not find the DB, even when it displays the correct file string.
Here is what I tried and it does not work. Maybe it is too old to run
..NET on.
It is a Pentium 120.
Does anyone have any more ideas how to make this work?
Thanks,
Al
-------------------------------
Here is the code it now has:
'
'DBConn
'
Me.DBConn.ConnectionString =
CType(configurationAppSettings.GetValue("DBConn.ConnectionString",
GetType(System.String)), String)
----------------------------------
Here is the code that does not find the file:
Dim str As String
Dim int As Integer
Dim Adapt1 As OleDb.OleDbDataAdapter
'Create SQL Statement
str = "SELECT tYear FROM tAutos GROUP BY tYear ORDER BY tYear"
'Load table
Adapt1 = New OleDb.OleDbDataAdapter(str, DBConn)
Try
DBConn.Open()
Catch
MessageBox.Show("Database file can not be found.")
MessageBox.Show(DBConn.DataSource)
Application.Exit()
End Try
-----------------------------------------------
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"/> -->
<!--StartFragment -->
<add key="DBConn.ConnectionString" value="Jet OLEDB:Global Partial
Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDBatabase 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 OLEDBon't Copy Locale on
Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User
ID=Admin;Jet OLEDB:Global Bulk Transactions=1" />
</appSettings>
</configuration>