virtual path for data connection string

  • Thread starter Thread starter Martin Williams
  • Start date Start date
M

Martin Williams

I created my data adapters and connection in the designer. How do I change
the path so that it works no matter where I deposit the application
(preparing a deployment for my project...)? Thanks for all replies.

Regards,
Martin Williams
 
Hi Martin,

Till now, and I watch this very firm, there is no solution for that, it was
always one of my problems, now I don't use the adapterwizard or any other
database wizard anymore.

The only thing you can do as a workaround is place the access database in
your program directory. Because that is the only directory that is on every
Window system the same.

If you want it I can provide you the (basicly) code to do it without the
wizard, it is not that big trouble.

Cor
 
Hi Martin,

Basicly this is all you need to read and write a table in Access for a
single user
Of course you have to do error handling and check integrity.
\\\ wach typeos because it is not checkend when I composed it
Dim conn As OleDb.OleDbConnection = New OleDb.OleDbConnection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\test1\db1.mdb;User Id=admin;Password=;"
Dim cmd1 As New OleDb.OleDbCommand(Select * from tbl", conn)
conn.Open()
Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(cmd)
Dim ds As DataSet = New DataSet
da.fill(ds)
dim cmb As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(da)
da.update(ds)
conn.Close
///

I hope this helps

Cor
 
Back
Top