VB如何从一个文件夹里查询多个数据库 50
2个回答
展开全部
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim SQL As String
Private Sub Command1_Click()
db.Open "PROVIDER=microsoft.jet.oledb.4.0;persist security info =false;data source=AFC.mdb;Jet OLEDB:Database Password="
SQL = "select * from 表1"
rs.Open SQL, db, 1, 3
Text1.Text = rs.RecordCount
rs.Close: db.Close
Set rs = Nothing
Set db = Nothing
End Sub
'注意,表1更改为你需要的表
Dim rs As New ADODB.Recordset
Dim SQL As String
Private Sub Command1_Click()
db.Open "PROVIDER=microsoft.jet.oledb.4.0;persist security info =false;data source=AFC.mdb;Jet OLEDB:Database Password="
SQL = "select * from 表1"
rs.Open SQL, db, 1, 3
Text1.Text = rs.RecordCount
rs.Close: db.Close
Set rs = Nothing
Set db = Nothing
End Sub
'注意,表1更改为你需要的表
展开全部
Set Rs1 = Server.CreateObject("ADODB.Recordset")
Set Rs2 = Server.CreateObject("ADODB.Recordset")
sql1 = "select * From [表一]"
sql2 = "select * From [表二]"
Rs1.Open sql1,conn,1,1
Rs2.Open sql2,conn,1,1
Set Rs2 = Server.CreateObject("ADODB.Recordset")
sql1 = "select * From [表一]"
sql2 = "select * From [表二]"
Rs1.Open sql1,conn,1,1
Rs2.Open sql2,conn,1,1
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询