在xp和access03运行没问题,换到win10和access2016就出错Publicmrc1AsADODB.RecordsetPublicmsgtextAsStringPublicfindstr1AsStringPublicmrc11AsADODB.RecordsetPublicmsgtext1AsStr...
在xp和access03运行没问题,换到win10和access2016就出错
Public mrc1 As ADODB.Recordset
Public msgtext As String
Public findstr1 As String
Public mrc11 As ADODB.Recordset
Public msgtext1 As String
Public FindStr11 As String
Public temp1 As String
Public num1, num2, num3 As Integer
Public fff, fff1 As Integer
Public max1, hmax1 As Single
Public Function ExecuteSQL(ByVal SQL As String, Msgstring As String) As ADODB.Recordset
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim sTokens() As String
sTokens = Split(SQL)
Set cnn = New ADODB.Connection
cnn.Open Connectstring
If InStr("insert,delete,updata", UCase$(sTokens(0))) Then
cnn.Execute SQL
Msgstring = sTokens(0) & "query successful"
Else
Set rst = New ADODB.Recordset
rst.Open Trim$(SQL), cnn, adOpenKeyset, adLockOptimistic
Set ExecuteSQL = rst
End If
ExecuteSQL_Exit:
Set rst = Nothing
Set cnn = Nothing
Exit Function
End Function
Public Function Connectstring() As String
Connectstring = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" & App.Path & "\data\yzcl.mdb"
End Function
(把3.51换成4.0也不行)
展开