.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 16th, 2004, 11:00 PM
me1258 me1258 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 me1258 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question data source during deployment

Please some one give me a clear answerI can't seem to find the answer to this question any where.


Lets say I make a program with 2 forms.
Each with a combo box or txt box...what ever....that is attached to an access database.

I want to sell my program to joe schmoo.

Now the program works fine on my puter because the path of C:/MyProgram
is a valid path BUT joe schmoo needs to install the program and the database.

NOW how do I get that path of c:/MyProgram to change to where ever joe installs it on his puter.

I cant believe the troble I have had finding the answer to this question...as if I am the only one in the world who wants to
deploy a program with a database attached.....UGH

Thanks


Reply With Quote
  #2  
Old April 19th, 2004, 11:28 AM
pmuk pmuk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: USA
Posts: 21 pmuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question data source during deployment

Is your application in c:/MyPrograms ?

Reply With Quote
  #3  
Old April 19th, 2004, 01:47 PM
me1258 me1258 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 me1258 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy

This is just theoretical, but yes, lets say my Database is at C:/MyApplication
As is teh application itself.

when you buy this applicaton from me my connection string has the path of
c:/MyApplication.MyDB.MDB for the database.

Lets say you install the application along with the database...which is packaged with the
application......at c/YourApplication
The program will not connect to the database because the connection string is set to
my path name not yours.

There must be some way to change it or something


Thanks

Reply With Quote
  #4  
Old April 20th, 2004, 01:00 PM
pmuk pmuk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: USA
Posts: 21 pmuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb data source during deployment

If your database is in the same folder where your application executable is, then dont hardcode your database path while connecting the string.

a)
Instead, get the path of your application using:-
Dim Str1 as string = Path.GetDirectoryName(Application.ExecutablePath)

concatenate the string with ur database like this:-
Str1 = Str1 & "\MyDatabase.mdb"

and then connect with this Str1.

b)
While making deployment project, make sure the database is in the same folder where ur application executable is.

It will ask for the path when Joe installs ur application. wherever he installs ur application, it also puts ur database there. And conncects to the database using the Str1 string.

Try this one...

Regds,
pmuk





Reply With Quote
  #5  
Old April 26th, 2004, 11:49 PM
aforezli aforezli is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Calgary
Posts: 5 aforezli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 44 sec
Reputation Power: 0
This is Not Working For ME!!!

When I type this line, the "Path" is underlined:
Path.GetDirectoryName(Application.ExecutablePath).
Do I need to import something?

Reply With Quote
  #6  
Old April 27th, 2004, 10:29 AM
pmuk pmuk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: USA
Posts: 21 pmuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile data source during deployment

Yes, you need to this:
Import system.IO

Sorry for not mentioning that previously...Hope this helps now.

Reply With Quote
  #7  
Old May 13th, 2004, 12:06 PM
paullie paullie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 paullie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry 2nd user

If the database is in the app folder on a users machine,
how does a 2nd user connect to the database.
Paullie

Reply With Quote
  #8  
Old June 15th, 2004, 10:57 PM
aforezli aforezli is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Calgary
Posts: 5 aforezli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 44 sec
Reputation Power: 0
Smile

That's when you would want to put the database on a server and both computers access it on the server.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > data source during deployment


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap