VB 2005使用外部XML文件进行数据库连接! [英] VB 2005 Database connection using an external XML file!

查看:86
本文介绍了VB 2005使用外部XML文件进行数据库连接!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该在哪里在XML文件中放置访问字符串的连接字符串,数据库用户名和密码?

where should I place the connection string, database username and the password for an access database in an XML file?

推荐答案

XML不是数据库-它是一种扁平的,人类可读的(基于文本的)文件格式.它可以被视为原始数据库,因为可以在其中组织数据,但这不是处理频繁更改,被多个用户访问或需要搜索或索引的信息的好方法.如果需要这些功能,则需要查看适当的"数据库系统.

它还没有用户"或密码"的概念.

连接字符串仅包含文件的路径,因此您可以将其放在自己喜欢的位置!我建议您将其存储在应用程序配置文件中,以便在需要时可以移动该文件.
XML is not a database - it is a flat, human readable (text based) file format. It can be treated as a primitive database, in that data can be organised within it, but it is not a good way to handle information that will be changed frequently, accessed by multiple users, or which requires searching or indexing. If you need these features, then you need to look at a "proper" database system instead.

It also does not have a concept of "users" or "passwords".

The connection string consists solely of the path to the file, so you can put it where you like! I would recommend you store it in your application config file so that you can move the file should you need to.


为什么不使用App.Config文件?
Why don''t you use App.Config file?


然后如何在vb 2005和vb 2008中使用App.Config文件?我不想将XML文件用作数据库,但是我真的需要它来在外部存储数据库的用户名和密码.这样我就可以轻松重置数据库密码,而无需再次编译整个程序!
Then how can I able to use App.Config file within vb 2005 and vb 2008? I want to use the XML file not as a database but I really need it to store the username and password of the database externally. So that I will able to reset the database password easily without compiling the whole program again!


这篇关于VB 2005使用外部XML文件进行数据库连接!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆