473,407 Members | 2,598 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,407 software developers and data experts.

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.Application.ExecutablePath & "\Datalog.mdb"

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

I tried "StartupPath" 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 1462
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.Application.ExecutablePath & "\Datalog.mdb"
usedConnection.connectionstring =
OleDbConnection("Provider=Microsoft.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.usedconnection ??

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**********@planet.nl> wrote in message
news:O8*************@TK2MSFTNGP11.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.Application.ExecutablePath & "\Datalog.mdb"
usedConnection.connectionstring =
OleDbConnection("Provider=Microsoft.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.usedconnection ??

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
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...
0
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...
1
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...
2
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...
0
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...
1
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...
16
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...
1
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...
4
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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,...

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.