求助如何把VBA转为VFP
Dim Cnn As Object, cnnschema As Object, constring$, Sql$Set Cnn = CreateObject("adodb.connection")
constring = "provider=Microsoft.ace.OLEDB.12.0;Data Source=" & ThisWorkbook.Path & "\dgch_2019.mdb"
Cnn.Open constring
Set cnnschema = Cnn.OpenSchema(20) '已连接数据库的结构
While Not cnnschema.EOF
If cnnschema!TABLE_TYPE = "TABLE" And Not cnnschema!table_name Like "*~TMP*" Then
Sql = "select * into [odbc;driver={SQL Server};server=localhost;database=DGCH_2021;uid=sa;pwd=Sa123456].[" & _
cnnschema!table_name & "] from [" & cnnschema!table_name & "]"
Cnn.Execute Sql
End If
cnnschema.MoveNext
Wend
Cnn.CloseIYF