dd 发表于:2014-10-08 12:44:02
Public Function BtnDisplayZZZ()
Dim btn As Label, H As Integer
Dim SQL As String
Dim db As Database
Dim rec As DAO.Recordset
Dim bTop As Integer
For X = 1 To 20
Set btn = Me.Controls("ABT" & Format(X, "00"))
btn.Visible = False
Next
Set db = CurrentDb()
If BTZZZ > 6 Then
MenuBox.Visible = False
Exit Function
End If
SQL = "SELECT Menutbl.Button, Menutbl.Label, Left([button],1) AS btn FROM Menutbl WHERE (((Menutbl.Label) Is Not Null) AND ((Left([button],1))=" & BTZZZ & "));"
Set rec = db.OpenRecordset(SQL, dbOpenDynaset)
Do While Not rec.EOF
H = H + 1
Set btn = Me.Controls("ABT" & Right(rec(0), 2))
If H = 1 Then
bTop = 1120
Else
bTop = bTop + 330
End If
btn.Visible = True
btn.Top = bTop
btn.Caption = rec(1)
rec.MoveNext
Loop
MenuBox.Visible = True
MenuBox.Height = BoxH(H)
rec.Close
Set rec = Nothing
Set db = Nothing
End Function
这段代码升迁到sql后就找不到DAO了,总提示未定义! 该作何处理,求大神!
在引用中去勾选DAO
自升迁到sql后,引用显示灰色,无法打开嘛
是ACCESS么?什么版本?
先停止工程,再去点引用
手动引用dao
总记录:6篇 页次:1/1 9 1 :