473,666 Members | 2,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

deployment and database location

Ben
Hi all
I have made a vb.net windows app that works great in design. But after deploying the app on the same design computer (my own) the app can not find any of the two databases it needs to operate. I have tried setting their connection strings to application.sta rtupath, but with no luck.
My question is, what is the correct way to code a connection string so that it will be seen by the app on any computer when deployed, especially when one of the databases has a dataset.
Right now I have a copy of both databases in the application folder and in the bin and debug folders for testing and they are still not found by the .exe
Nov 20 '05 #1
3 1497
Post your connection strings and tell us where the databse is in reality (
path \\servername\sh are\dbname )

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Ben" <Be*@discussion s.microsoft.com > wrote in message
news:08******** *************** ***********@mic rosoft.com...
Hi all
I have made a vb.net windows app that works great in design. But after deploying the app on the same design computer (my own) the app can not find
any of the two databases it needs to operate. I have tried setting their
connection strings to application.sta rtupath, but with no luck. My question is, what is the correct way to code a connection string so that it will be seen by the app on any computer when deployed, especially
when one of the databases has a dataset. Right now I have a copy of both databases in the application folder and in

the bin and debug folders for testing and they are still not found by the
..exe
Nov 20 '05 #2
Ben
Ok
Here are the two strings I now use

Con.ConnectionS tring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & Replace(Applica tion.StartupPat h, "bin", "") & "Book.mdb"

This one below is the one to which there is a dataset attached and the code is copied from in the Windows Form Designer generated code area:

Me.odcBooks.Con nectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=""C:\Doc uments and Settings\My Name\My Documents\V" & _
"isual Studio Projects\About My Books\Books.mdb "";Jet OLEDB:Engine Type=5;Pro" & _
"vider=""Micros oft.Jet.OLEDB.4 .0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False ;p" & _
"ersist security info=False;Exte nded Properties=;Mod e=Share Deny None;Jet OLEDB:E" & _
"ncrypt Database=False; Jet OLEDB:Create System Database=False; Jet OLEDB:Don't Cop" & _
"y Locale on Compact=False;J et OLEDB:Compact Without Replica Repair=False;Us er ID" & _
"=Admin;Jet OLEDB:Global Bulk Transactions=1"


"One Handed Man ( OHM - Terry Burns )" wrote:
Post your connection strings and tell us where the databse is in reality (
path \\servername\sh are\dbname )

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Ben" <Be*@discussion s.microsoft.com > wrote in message
news:08******** *************** ***********@mic rosoft.com...
Hi all
I have made a vb.net windows app that works great in design. But after

deploying the app on the same design computer (my own) the app can not find
any of the two databases it needs to operate. I have tried setting their
connection strings to application.sta rtupath, but with no luck.
My question is, what is the correct way to code a connection string so

that it will be seen by the app on any computer when deployed, especially
when one of the databases has a dataset.
Right now I have a copy of both databases in the application folder and in

the bin and debug folders for testing and they are still not found by the
..exe

Nov 20 '05 #3
The reason is simple.

You originally were in a Bin folder at the end of your project directory
structure. Your replace replaces Bin with "", this leaves you with

..........\

However, when you deploy this, if your directort does not end in bin, then
no replace is done. So Lets say you deployed to C:\TEST, your formula for
the connection string would result in the following
C:\TESTBOOK.MDB
SO . . . use a preprocessor directive

#If DEBUG Then

'Set your paths accordingly

#Else

'set your paths accordingly

#End If

OR

Add an app.config file and set a new key for this and have your program
read it on startup.



--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Ben" <Be*@discussion s.microsoft.com > wrote in message
news:BE******** *************** ***********@mic rosoft.com...
Ok
Here are the two strings I now use

Con.ConnectionS tring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & Replace(Applica tion.StartupPat h, "bin", "") & "Book.mdb"
This one below is the one to which there is a dataset attached and the code is copied from in the Windows Form Designer generated code area:
Me.odcBooks.Con nectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _ "ocking Mode=1;Data Source=""C:\Doc uments and Settings\My Name\My Documents\V" & _ "isual Studio Projects\About My Books\Books.mdb "";Jet OLEDB:Engine Type=5;Pro" & _ "vider=""Micros oft.Jet.OLEDB.4 .0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False ;p" & _ "ersist security info=False;Exte nded Properties=;Mod e=Share Deny None;Jet OLEDB:E" & _ "ncrypt Database=False; Jet OLEDB:Create System Database=False; Jet OLEDB:Don't Cop" & _ "y Locale on Compact=False;J et OLEDB:Compact Without Replica Repair=False;Us er ID" & _ "=Admin;Jet OLEDB:Global Bulk Transactions=1"


"One Handed Man ( OHM - Terry Burns )" wrote:
Post your connection strings and tell us where the databse is in reality ( path \\servername\sh are\dbname )

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Ben" <Be*@discussion s.microsoft.com > wrote in message
news:08******** *************** ***********@mic rosoft.com...
Hi all
I have made a vb.net windows app that works great in design. But after

deploying the app on the same design computer (my own) the app can not find any of the two databases it needs to operate. I have tried setting their
connection strings to application.sta rtupath, but with no luck.
My question is, what is the correct way to code a connection string so

that it will be seen by the app on any computer when deployed, especially when one of the databases has a dataset.
Right now I have a copy of both databases in the application folder
and in the bin and debug folders for testing and they are still not found by the ..exe

Nov 20 '05 #4

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

Similar topics

0
1534
by: Andy | last post by:
Hey All, I'm a beginner with VB.Dotnet Deployment and I'm a little confused about some very basic deployment issues . . . I've now created some core assemblies that will be used throughout all of our applications that run on various machines on our local network. I understand that the global assembly cache exists on each machine where the CLR is installed. But don't I want to establish just one global assembly cache on say one of our...
4
3519
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the application initially. I have VS 2002, Windows XP, Access XP(2000 format). He is my problem....
0
862
by: Ian Henderson | last post by:
Hi folks I am currently writing all of my front-end applications in VB.NET 2002, and deploying them to the user's local machine using a deployment project. However, we now want to change the way in which we grant access to these applications. Therefore, I have been asked to come up with a solution whereby the application can reside in a central location on the network, and users can access it as needs be. I've been working on this on...
1
2775
by: moondaddy | last post by:
I need to have multiple deployment profiles for a .net 2.0 winforms project. This is my requirement: 1) Re-use same project for multiple ClickOnce deployment profiles. 2) Each profile will have it's own custom deployment properties such as Publish Version Number, Start Menu and application Name in start menu. For example, in the past (before ClickOnce deployment) I had to build Setup.exe files and distribute them to various...
1
1880
by: Gene | last post by:
I would like to know if the following is even possible with the visual studio.net Setup and Deployment project. 1. During the deployment after creation of application directory the setup needs to prompt user to select another location to send a data file elsewhere on target machine (with ability to create this directory). 2. After that this secondary location selected/created by the user,
4
1413
by: esha | last post by:
I have ASP.NET 2 hosting. I created my first simple WEB application from Personal WEB Starter Kit template. Everything works fine on my local machine. I uploaded all files to the hosting server. Pages which do not use database work, pages which communicate with the database do not work. I'm just starting to learn programming and have not enough knowledge to realize what's wrong. I just suspect that I have to change ConnectionString in...
4
2352
by: Zany | last post by:
I added a Web Deployment Project so I can create a debug, staging, and release version. Each set is compiled and saved in a separate folder under the csproj_deploy folder. All works fine. Here's the problem - I'm looking for an *easy* way to upload (ftp) changed files. I don't want to upload them all (huge upload), and don't want to have to it manually by remembering what files have changed. I thought I had the solution when I found a...
1
3750
by: Brad Isaacs | last post by:
I am working with ASP.NET 2.0 and using an SQL Server 2000 database. I am using Visual Studio 2005 and developing on my Local machine. I am working with Login controls ASP.Configuration, I wanted to move my work and needed to place it on the server. Using VS 2005 , went to BUILD -Publish Web Site Checked the box for :: Alow this precompiled site to be updatable.
2
1115
by: Doug | last post by:
Hi I am ready to deploy my app to some testers who have agreed to do some beta testing. I have some questions that I would like some advice on please. Some of the people who will use my application will be on 'partially locked down networks', ie. their program files folder will be read only. They would need to get system administrators to allow them to install it or go
0
1964
by: =?Utf-8?B?VCFN?= | last post by:
Hi All, I've been successfully deploying clickOnce successfully through the 2.0 and 3.X frameworks, but now have a problem with ClickOnce updates in 3.5 SP1. The scenario is this: I want to deploy an *offline* application that can only be installed from behind our organizational firewall (a Win2k3 domain), but can be updated from anywhere (hotels, etc). To do this, the publishing folder location is set to a UNC share path:
0
8363
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
8883
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...
1
8561
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
5672
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1778
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.