大家好,又见面了,我是你们的朋友全栈君。
在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也不行)
展开
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/127328.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...