1. 建立数据源“ vb数据库编程技术实例/三数据控件/VB中使用ODBC”第一个例子,或者仔细看几个图2. 工程/引用使用建立连接代码或者增加工程/控件建立连接代码:Public cn As New ADODB.ConnectionDim strSql As StringstrSql = dsn=student;uid=sa;pwd=zoustrSql = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:实验实习student.mdb;Persist Security Info=Falsecn.Open strSql对数据库表进行操作代码:Dim rst As New ADODB.RecordsetMsgBox 请先输入数据cn.Execute insert into student (studentid,studname,studsex,studbir) values ( & Trim(Text1.Text) & , & Trim(Text2.Text) & , & Trim(Text3.Text) & , & Trim(Text4.Text) & ) rst.AddNew rst(studentid) = Text1.Text rst.Update