-
Database path
[Originally posted by Tim Stutzman]
In my VB app I have the database path hard coded.’ But what if the user wants to move it to a different location?’ How can I set it up so the user can change where the app is looking for the database without haveing to change code?
Thanks
Tim
-
Re:Database path
[Originally posted by Muhammad Zahid Rafiq]
The best way of this to make a DSN and then no probelm where the data base is reside.
If user change the path then he need to only set that path in DSN and it is working fine.
any probelm let me know back
Zahid M Rafiq
Zahidraf@hotmail.com
-
Re:Database path
[Originally posted by m.posseth]
hmmm dsn ???
i don`t like them at all i just use a standard connection string with a database path variable that is set at runtime ,,,
hope this helps
happy coding :-)
-
Re:Database path
[Originally posted by Kevin]
DSNs are Ok but, you may find it easier to just read an ini file in the app path.’ After installing the program on each user's machine, you run a setup routine from your program's Tools menu.’ Through the use of the Common Dialog, you user browses to the location of the data.’ You can use this same technique to set printers and other user preferences as well.’ It is simple and effective and far less complicated than using the registry.’ Send me an Email and I'll send you an example.
-
Re:Re:Database path
[Originally posted by m.posseth]
yes but requires user interaction ,,,
i make several projects ,where i even’ give the user the ability to let the database on the cd-rom during setup ,,,
however it could be possible that the user later makes a complete install , or asigns another drive letter to his cd-rom , or even better copies the data to a shared network drive ,,,
to make a solution for all of the above seems complicated ,, but is acomplished during runtime whitout any user interaction ( except if it detects no data at all wich should mean that the d-rom was forgotten , or the network is down _)
i do this by building my connection string during runtime , just give the database a uncommen name and search for it if you won`t find it in the expected place. This is proofed technology’ works for over 30.000 of my users all across europe :-)
and about DSN`s it maybe, just a mather’ of taste but i don`t see any use for them
-
Re:Re:Re:Database path
[Originally posted by Andon K.]
IMHO, DSNs are good only when there is no native OLE DB provider for the database, so the only possibility is to use the ODBC provider.
Otherwise, a much better way is to setup connection strings at runtime by reading them from a file (I use .INI files), or from the registry or a database, when more security is needed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks