Office中国论坛/Access中国论坛

标题: DAO.Database [打印本页]

作者: horoscope    时间: 2002-12-11 05:07
标题: DAO.Database
Private Sub Form_Load()
On Error GoTo me_error

Dim db As DAO.Database, dbtable As TableDef
Dim mypath As String
Dim i As Integer

'在状态栏中显示信息
Dim xx As String
Dim returnvalue
returnvalue = SysCmd(acSysCmdSetStatus, " ")
xx = "当前操作员:" & DBEngine.Workspaces(0).UserName & "  当前计算机:" & atCNames(2)
returnvalue = SysCmd(acSysCmdSetStatus, xx)

'增加需要导出的表
Set db = CurrentDb()
Me.tablelist.RowSource = ""
For Each dbtable In db.TableDefs
    If (dbtable.Attributes And dbAttachedTable) Then
    Me.tablelist.AddItem (dbtable.Name)
    End If
Next

mypath = CurrentProject.Path & "\outputfile\"
txtmypath.Value = mypath

'禁止工具栏上第二,三,四,五按钮
Application.CommandBars("工具栏2").Controls(2).Visible = False
Application.CommandBars("工具栏2").Controls(3).Visible = False
Application.CommandBars("工具栏2").Controls(4).Visible = False
Application.CommandBars("工具栏2").Controls(5).Visible = False


myerror:
Exit Sub

me_error:
MsgBox Err.Description, vbCritical, "错误"
    Resume myerror


End Sub
在ACCESS2000中报错:用户定义类型未定义
我认为是DAO.Database, dbtable As TableDef在2000中,不认。
我的帮助信息不全,哪可以下载。

作者: cattjiu    时间: 2002-12-11 16:58
有没有引用DAO啊?
作者: horoscope    时间: 2002-12-11 19:02
how and where to import DAO?
can u tell me?
thank u!
作者: cattjiu    时间: 2002-12-11 19:06
我用英文的,所以
Tools-->Macro-->Visual Basic Editor-->Tools-->references-->Microsoft DAO 3.6 Object Library




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3