当前位置:网站首页>Vb how to connect mysql_vb how to connect to the database collection "advice"
Vb how to connect mysql_vb how to connect to the database collection "advice"
2022-07-31 15:16:00 【Full stack programmer webmaster】
Hello everyone, meet again, I'm your friend Quanstack Jun.
How to connect vbDatabaseLibrary[edit]
Overview
When we operate the database, on the one hand, we must enable users to access the required data on the program interface; on the other hand, we can perform various operations on the data in the database, and the final operation results must be fed back to the user.
One, Data control
1. Set the properties of the data control
2. Connect the Data control to a specific database and one of its tables
3. Create a standard project in VB
4. Add a control to the form (Data1 is a Data control)
5. Change some properties of the control
6. Set the Data control (to set the Databasename property in the Data control, when this property is set, a pair will pop up
In the dialog box, you can select the path of the database. There may be many tables in a database. We also need to specify a table, which can be passed through the Data control
Recordsource property to set)
7. Run the program
Second, ADO controls
ADO is an interface to the OLE database.It was introduced in VB6, it is a new data access technology from Microsoft, it is not easy to store in any format
Provide access to any data.ADO supports access to relational and non-relational databases, as well as other data sources.
1. Settings for connecting to the database
2. Specify a custom connection string to connect to the data source
3. Define a connection string to the data source
Three, connection method
(1) Using text files
1. Read the file
2. Formatting data
3. Close the file
4. Use data
5. If the amount of data is large and needs to be filtered, and the source file storing the data may change from time to time, then we can use a temporary file to store useful data
This can greatly improve the efficiency of the program
(2) The use of the database
1. Open the database
2. Find data
3. Use data
4. Close the database
(3) Reference a class that contains access to the database
1. Adopt ADODB
2. Compared with DAO and the API that can access the database, it is more flexible and powerful than DAO
3. Compared with API, it is easier to use and more suitable for beginners
4. Access is selected
(4) Database programming
1. Quote ADO
2. Create an object in the program
3. Open the database
4. Compare the password entered by the user to see if the login is allowed
5. Query records
6. Locate/filter information
7. Add/modify records
References:
Extended reading:
Related terms:
Database
Co-editors:
Share to:
More
The contents of the Internet Marketing Dictionary are provided by netizens for reference only.If you find any problem with the content of the entry, please send an email to info # wm23.com.
Publisher: Full-stack programmer, please indicate the source: https://javaforall.cn/128255.htmlOriginal link: https://javaforall.cn
边栏推荐
猜你喜欢
随机推荐
thread_local 变量的析构顺序
最小费用最大流问题详解
乡村基冲刺港交所:5个月期内亏2224万 SIG与红杉中国是股东
Getting Started with TextBlock Control Basic Tools Usage, Get Started
数据库的范式(第一范式,第二范式,第三范式,BCNF范式)「建议收藏」
WeChat chat record search in a red envelope
蔚来杯2022牛客暑期多校训练营4
Ubantu专题5:设置静态ip地址
TRACE32 - Common Operations
Linux查看redis版本(查看mongodb版本)
女性服务社群产品设计
Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
实现防抖与节流函数
公告
LeetCode二叉树系列——226.翻转二叉树
[CUDA study notes] First acquaintance with CUDA
TCP详解
button控件的使用
Trigonometric identity transformation formula
org.apache.jasperException(could not initialize class org)









