Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 19th, 2006, 03:56 PM
Authorized User
 
Join Date: Dec 2006
Location: Manila, , Philippines.
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
..................................................
Reply With Quote
  #2 (permalink)  
Old December 29th, 2006, 12:35 PM
Authorized User
 
Join Date: Oct 2005
Location: , , USA.
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.




Reply With Quote
  #3 (permalink)  
Old December 31st, 2006, 02:51 PM
Authorized User
 
Join Date: Aug 2006
Location: Charlotte, NC, USA.
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)
Reply With Quote
  #4 (permalink)  
Old January 6th, 2007, 12:33 AM
Authorized User
 
Join Date: Dec 2006
Location: Manila, , Philippines.
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
..................................................
Reply With Quote
  #5 (permalink)  
Old January 9th, 2007, 12:33 PM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
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
Reply With Quote
  #6 (permalink)  
Old March 6th, 2007, 10:22 AM
Authorized User
 
Join Date: Dec 2006
Location: Manila, , Philippines.
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
..................................................
Reply With Quote
Reply


Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 05:36 PM



All times are GMT -4. The time now is 08:17 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.