VB如何调用ACCESS数据库?如何生成EXCEL表?

2024-12-18 19:52:01
推荐回答(1个)
回答1:

(1)引入ado,工程,引用,microsoft activex data objects 2.6

(2)Dim Con As New ADODB.Connection 数据库连接
Dim Rs As New ADODB.Recordset 记录集
Con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB;Persist Security Info=True"
'data source是数据库完整路径
Con.Open
Rs.Open "select * from Employees", Con, adOpenDynamic, adLockPessimistic '这个是打开employees
打开表,一般都是这样的.致于下面我看你要写过程了