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
| FAQ | Members List | 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 Search this Thread Display Modes
  #1 (permalink)  
Old March 10th, 2006, 08:11 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting to XML file in VB

Hi..All.. I'm doing an application in VB 6.In this application I've an XML file which has a Provider and Datasource for connecting to Database.The XML file looks like this.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="strConn" value="Provider = Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\Northwind.mdb;User ID=Admin;Password=;" />
</appSettings>
</configuration>

How can I connect this to my VB application so that I can connect it to the database.
I know I can connect to my Database directly using DSN or taking the connection string and giving the provider.But I want to connect it through an XML file because when my client chenges the Database path,they can just chenge it in that XML file and they need not face many problem if they replace the database path.
Please help if you know this.
Thanks in advance

Reply With Quote
  #2 (permalink)  
Old March 10th, 2006, 08:41 AM
Authorized User
 
Join Date: Mar 2006
Location: Bratislava, , Slovakia.
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

1) Use XML Parser to get connection string,
2) Use ADO.Connection object to connect DB.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
VB.net, adding XML data to an existing XML file saikoboarder XML 11 April 17th, 2008 04:19 PM
connecting Excel file in VB.NET 2005 vish_vj ADO.NET 1 March 1st, 2008 10:37 AM
Connecting to dat file from access or VB shaiss Access VBA 0 December 31st, 2005 02:21 PM
How to connecting java script form to xml file ashraf Javascript How-To 1 December 10th, 2004 05:47 AM
Connecting an XML listener to a VB interface yeeck VB How-To 0 June 23rd, 2003 06:08 AM



All times are GMT -4. The time now is 04:51 PM.


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