473,662 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble locating database in depolyed application

Hi, I have an application that connectes using oledb connection to an access
database.

The program works fine in debug and release mode on the developement machine
but cannot locate the database file on another machine when I deploy the
application.

In code, I am using the following lines to make the connection...

temp = System.Windows. Forms.Applicati on.ExecutablePa th & "\Datalog.m db"

Dim myconnection As New
OleDbConnection ("Provider=Micr osoft.jet.oledb .4.0;Data Source = " & temp)

I tried "StartupPat h" also but same problem. On the target machine,the
exception indicates it is looking for the original path from the development
machine and not looking in the application's installed path.

Any help please will be much appreciated.

Thanks


Nov 22 '05 #1
3 1469
Hi David,

You did probably use the designer to make the connection. Than you have to
use that same connection and it becomes.

temp = System.Windows. Forms.Applicati on.ExecutablePa th & "\Datalog.m db"
usedConnection. connectionstrin g =
OleDbConnection ("Provider=Micr osoft.jet.oledb .4.0;Data Source = " & temp)

I hope this helps?

Cor
Nov 22 '05 #2
Cor,

I tried as you suggested but usedconnection was not a valid object ??

The version of VB.NET is 2003, should it be something like
system.forms.us edconnection ??

Also, upon closer inspection of my code, I found it was actually opening the
database ok but the problem actually occuredd when I tried to fill a
datagrid with a dataset. The dataset was created by dragging the table from
the Server Explorer, I expect that it has set up a fixed path to the table
somewhere. Could I establish the dataset manually so that I can point the
program to the startup directory ??

Thanks

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:O8******** *****@TK2MSFTNG P11.phx.gbl...
Hi David,

You did probably use the designer to make the connection. Than you have to
use that same connection and it becomes.

temp = System.Windows. Forms.Applicati on.ExecutablePa th & "\Datalog.m db"
usedConnection. connectionstrin g =
OleDbConnection ("Provider=Micr osoft.jet.oledb .4.0;Data Source = " & temp)

I hope this helps?

Cor

Nov 22 '05 #3
Hi David,

With usedConnection I mean the connection that you are using, that you can
see in the connection that is on your form down in the left mostly when you
do not drag them away,

If you use a conn.open than the name is that first name.

:-)

Cor
I tried as you suggested but usedconnection was not a valid object ??

The version of VB.NET is 2003, should it be something like
system.forms.us edconnection ??

Also, upon closer inspection of my code, I found it was actually opening the database ok but the problem actually occuredd when I tried to fill a
datagrid with a dataset. The dataset was created by dragging the table from the Server Explorer, I expect that it has set up a fixed path to the table
somewhere. Could I establish the dataset manually so that I can point the
program to the startup directory ??

Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
320
by: David | last post by:
Hi, I have an application that connectes using oledb connection to an access database. The program works fine in debug and release mode on the developement machine but cannot locate the database file on another machine when I deploy the application. In code, I am using the following lines to make the connection... temp = System.Windows.Forms.Application.ExecutablePath & "\Datalog.mdb"
0
1105
by: Anne | last post by:
hie there, i have a couple of questions that i need help on. the first is regarding the closing of a browser.i have an exit button which on click i would like it to totally close the browser, and not only closing the form itself.how can i write the coding for it? Me.Close() doesn't work in this case as it only closes the current application. my second question is relating to locating files from my hard drive (eg C:\) and display it to...
1
1684
by: Shiraz | last post by:
Hi It seems like none of the old posts get any follow up after a few messages, whether or not something constructive comes out of them, so I'm left with no choice but to repost an earlier question I asked. Below I've copy-pasted the log of the last post. It's an interesting problem, and it might well be worth reading if you are willing to be patient. As always, I would appreciate your comments immensely
2
9004
by: hfk0 | last post by:
Hello, I'm a newbie here and was wondering anyone could help me with this. I have a simple ASP.NET 2 web application running perfectly fine with IIS and SQLServerExpress installed locally on my WinXP as a testing server (I created the app in Visual Studio.NET 2005). When deploying this app on the production server (running Win2000 Server, IIS and SQLServerExpress 2005), I'm getting the following
0
1239
by: dmlinliverpool | last post by:
I am running VS.net 2005 Express and Sql Server 2005 Express. The DB and VS are both on the same PC. I cannot connect to a database from within VS. In Database Explorer I click Connect To Database to add an existing DB to the DB Explorer. In the dialog box I navigate to the MDF of my DB and after I click Test Connection it takes some 20 seconds before giving the error ..."Error
1
16431
by: steve1rm | last post by:
Hello, I have a problem trying to connect a remote sql server. The error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) DEVSQL computer name RealitySolutions instance name ...
16
1835
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I'm looking for a way to programmatically retrieve the following if possible: Windows Installation Key or COA from the registry Windows installed applications, like: MS Office 97-2003 MS FrontPage MS Word MS Works
1
5890
by: stuart.medlin | last post by:
I have an Access 2003 application that I recently converted from Access 97. I have a routine in which I use to export the data that the users have keyed into a text file. This text file resides on a network drive where the back end database resides so that multiple users can write to the same file. I have set up the path to the back end (under the Link Manager) using the UNC (univ. naming convention). When this export routine runs, I...
4
6698
by: jobs | last post by:
Works great on my client when I test from vs.net 2005. Howevever, when I deploy to the web server, I get this error: remotely and local from the web server. An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error...
1
2554
by: =?Utf-8?B?TWF5?= | last post by:
We are getting WebForm_DoPostBackWithOptions is not defined and other Java script errors related to WebResource.axd file. I narrowed down the problem and found out the cause but can't come up with a solution based on our application setup. Here is is how our web sites configured on IIS. Multiple web sites points to the same IP address and some of these web sites has sub-virtual directories, for example mystore.com is a web site that has...
0
8432
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8344
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8764
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8546
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6186
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.