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 March 10th, 2006, 08:11 AM
Registered User
 
Join Date: Mar 2006
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

 
Old March 10th, 2006, 08:41 AM
Authorized User
 
Join Date: Mar 2006
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.






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





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