473,416 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

VB.net - How to install it with other files

Hi

I would appreciate if someone could point me in the right direction.

I'm developing a small application which includes MS Access database in it.


When someone install it I need to know where the database was installed so I can update the connection string. Currently I use OnceClick VB 2008 feature and it doesn't alow me to specify the folder.

On Vista PC I have also some issues with the Access database if it is in C drive directly or Program Files folder it becames read-only and I cannot update/insert any records.


Many thanks in advance.
Emil
Jan 2 '09 #1
3 1204
lotus18
866 512MB
@emsik1001
Hi

The simplest way on how to do it is using Application.StartupPath as your connection path for your access database.

Something like

Expand|Select|Wrap|Line Numbers
  1. Imports System.Data.OleDb
  2.  
  3. Public conn As System.Data.OleDb.OleDbConnection
  4.  
  5. Public Sub SetConnection()
  6. conn=New System.Data.OleDb.OleDbConnection()
  7.         Try
  8.             conn.ConnectionString = ("Provider=Microsoft.Jet.OLEDB.4.0;" & _
  9.             "Data Source=" & Application.StartupPath & "\Database\MyDatabase.mdb;" & _
  10.             "Persist Security Info=False;Jet OLEDB:Database Password=password")
  11.             conn.Open()
  12.         Catch ex As Exception
  13.             MessageBox.Show(ex.Message, "Connection Failed", MessageBoxButtons.OK, MessageBoxIcon.Error)
  14.             conn.Close
  15. conn.Dispose
  16.         End Try

Rey Sean
Jan 3 '09 #2
Thanks that is what I was exactly looking for!!
Jan 3 '09 #3
Just an update

I have used this property to get the path but unfortunately my dataset has been using a different path.

After reading some forums I changed publish status to data file and used this property Application.UserAppDataPath to get the path and now my updates and dataset are synchronized.

Regards
Emil
Jan 3 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Craig D | last post by:
I got really tired of unpacking a distutils package, installing then cleaning up. So I wrote distinstall.py - it reads a zip file, unpacks it, installs the bits and cleans up. I've only used it on...
13
by: cab0san | last post by:
I downloaded the DB2 runtime client, but the Client Base support and the TCP protocol do not install. I re-run the setup select them to run from disk, and they still show as not installed. What am...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
1
by: Lori | last post by:
I created an install for my program. During installation, 3 User Interface dialogs display asking for values that will be stored in the registry. I'm not registering anything, just storing values...
3
by: Olav | last post by:
Hi all, I can not install CF 2.0 SP 1 on an Symbol PPT8800 running WinCE 4.2. The Install-Log say's cgacutil.exe failed with exit-code 80000004 and I get a messagebox indicating a support-Info...
5
by: Ajith Menon | last post by:
I have to install .NET framework 3.0. I already have .NET Framework 1.1 installed on my machine. I don't want to remove framework 1.1 since some of the critical applications are using it. While...
3
by: Anthony Smith | last post by:
I always get this message. No matter what package $ pear install Date PHP Warning: Module 'oci8' already loaded in Unknown on line 0 No releases available for package "pear.php.net/Date"...
1
by: kataoki | last post by:
Hi, This is the log file for my SP1 on 2005 install. Can anyone please look at this and tell me if this looks normal? I'm concerned about the following in the log: "Failed to read registry...
4
by: Amber | last post by:
The installer tells it faild to config db2inst1, the db2setup.err is as following: /usr/share/themes/Clearlooks/gtk-2.0/gtkrc:60: Engine "clearlooks" is unsupporte d, ignoring Jun 15, 2007...
0
by: Office97User | last post by:
In reply to the thread at http://www.thescripts.com/forum/thread622173.html . I have a slightly modified version of the steps involved that worked on my computer. 1. Install Office 97, but...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.