设计VB程序,需要将大量数据储存在数据库中,怎样将VB程序与数据库连接?

来源:百度知道 编辑:UC知道 时间:2024/05/25 17:50:41

有很多方法如ADO 或者ADO控件,还有DATA控件与DAO
DATA控件与ADO控件是VB中自带的,在“工程”中添加“部件”选择microsoft ado data control 6.0.用法如下
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\weldES.mdb;Persist Security Info=False" ‘连接数据库
Adodc1.CommandType = adCmdText ‘打开方式
Adodc1.RecordSource = "select * from gycard where materialId='" & cl & "'and materialHD='" & hd & "'and weldMethod='" & ff & "'" ’打开表
Adodc1.Refresh