Can not find a Access DB file when install on another PC.

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 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>
 
S

scorpion53061

Hi Al,

Check out http://www.kjmsolutions.com/flexibleconnectionstring.htm

I hope it helps.





________________________________

From: Al Repasky [mailto:[email protected]]
Sent: Tuesday, July 06, 2004 1:05 PM
To: microsoft.public.dotnet.framework
Subject: Can not find a Access DB file when install on another PC.



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 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>
 
S

Simon Smith

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?

The only way I've ever connected to an Access DB from .NET is via an Odbc
connection with a Connect String of the form "DSN=dsnName". The age of
the PC shouldn't affect this, I would have thought. Possibly the version
of MDAC you have loaded would though (later MDAC versions don't install
Access providers by default anymore).

The connection string you're using looks very complex to me -


<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" />


- I really son't know what 75% of it means!
 
P

Phil Wilson

That sounds right - MDAC doesn't install the Jet engine any more - that
could be the redist he's missing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top