Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 19th, 2006, 04:56 PM
Authorized User
 
Join Date: Dec 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to h@ckerz Send a message via Yahoo to h@ckerz
Default VB.NET 2005 to MS Access

hi,
   hello, specially to the author of beginning vb.net 2005, i have a little question regarding data connection from vb.net to ms access, in vb.net 2003 you can easily drag and drop the data connection components (data adapter,data set, data connection..etc) on toolbars, in more advance, how can i have a connection from my database in terms of codes. my problem in drag and drop components is when i relocate my database(ms access) to other location the system will search for data source search on previous location. In what way can resolve this by using code, and where ever folder in my project folder place the database the system will find it, thus bin folder should be the right place for databse location?

h@ckerz
__________________
................ h@ckerz ....................
If you can\'t join them.....HACK them
..................................................
 
Old December 29th, 2006, 01:35 PM
Authorized User
 
Join Date: Oct 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by h@ckerz
 hi,
   hello, specially to the author of beginning vb.net 2005, i have a little question regarding data connection from vb.net to ms access, in vb.net 2003 you can easily drag and drop the data connection components (data adapter,data set, data connection..etc) on toolbars, in more advance, how can i have a connection from my database in terms of codes. my problem in drag and drop components is when i relocate my database(ms access) to other location the system will search for data source search on previous location. In what way can resolve this by using code, and where ever folder in my project folder place the database the system will find it, thus bin folder should be the right place for databse location?

h@ckerz
Well if you want you can put in your code a default location..if it fails ("Have A TRY/Catch block")then have a Open prompt so, therefore you can search through the drive or even another computer drive (if you are in a LAN) and then set the file and use the location of the new file (your MS access file) to become the new Source connection based on where you just put it in.




 
Old December 31st, 2006, 03:51 PM
Authorized User
 
Join Date: Aug 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anubisascends
Default

Also, you can save the connection string as a setting, then once the user selects a different DB location, the program will update the settings and won't have to continually look for the database.

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein
US (German-born) physicist (1879 - 1955)
 
Old January 6th, 2007, 01:33 AM
Authorized User
 
Join Date: Dec 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to h@ckerz Send a message via Yahoo to h@ckerz
Default

can i write a class that will search for my database in current folder.. but how?


................ h@ckerz ....................
If you can't join them.....HACK them
..................................................
 
Old January 9th, 2007, 01:33 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by h@ckerz
 can i write a class that will search for my database in current folder.. but how?


................ h@ckerz ....................
If you can't join them.....HACK them
..................................................
Yes. You can easily search for the mdb file in the "current" folder and build your connection string based on the file being there. What part of this are you having problems with?

Woody Z
http://www.learntoprogramnow.com
 
Old March 6th, 2007, 11:22 AM
Authorized User
 
Join Date: Dec 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to h@ckerz Send a message via Yahoo to h@ckerz
Default

the thing that i want to do is, i'll a system and make it a installer.... so where ever pc i want to installer the system that i do, i could. i also want to know, what should i do if i were in developing stage im using the directory c:\folder name to locate my mdb, then make it installer.. the thing that i want is, when i install the system in other directory othe than c:\folder name, how could the system look for the mdb if in developing stage im using c:\folder name?

................ h@ckerz ....................
If you can't join them.....HACK them
..................................................





Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access With VB.NET N4T3.T4NN3R ADO.NET 0 October 9th, 2008 01:47 PM
Problem VB.NET 2005 - update data in Ms Access Netuser Pro Visual Basic 2005 0 August 1st, 2008 01:34 PM
Vb.net 2005 using MS Access johnnys14 SQL Language 0 July 10th, 2008 01:14 PM
MS ACCESS 2003 FRONTEND AND MS SQL SERVER 2005 DB mohankumar0709 SQL Server 2005 3 March 23rd, 2007 12:48 AM
MS VB 2005 vs. MS VB 2005 Express NevadaBob Visual Basic 2005 Basics 2 January 24th, 2006 06:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.