使用ADO 将ACCESS数据库中的表导入到MYSQL数据库中
Dim AdoRst As New ADODB.Recordset 'MySql 数据库的ST表
Dim Adoact As New ADODB.Recordset 'ACCESS 数据库的ST表
Dim i As Integer
AdoRst.Open "ST", "DRIVER={MySQL ODBC 3.51 Driver};SERVER=127.0.0.1;DATABASE=mydb;;USER=root;PASSWORD=********;OPTION=3;", adOpenStatic, adLockOptimistic, -1
Adoact.Open "st", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ks.mdb;Persist Security Info=False"
Dim AdoRst As New ADODB.Recordset 'MySql 数据库的ST表
Dim Adoact As New ADODB.Recordset 'ACCESS 数据库的ST表
Dim i As Integer
AdoRst.Open "ST", "DRIVER={MySQL ODBC 3.51 Driver};SERVER=127.0.0.1;DATABASE=mydb;;USER=root;PASSWORD=********;OPTION=3;", adOpenStatic, adLockOptimistic, -1
Adoact.Open "st", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ks.mdb;Persist Security Info=False"
Dim tt() As Byte
Dim ss() As Byte
tt = adoact.Fields(1).Value
ss = adoact.Fields(2).Value
AdoRst.AddNew
AdoRst.Fields(0).Value = i
AdoRst.Fields(1).Value = tt
AdoRst.Fields(2).Value = ss
AdoRst.Update