Office中国论坛/Access中国论坛

标题: 请教!如何将表导出到另个带密码的数据库中? [打印本页]

作者: sxgaobo    时间: 2012-12-23 11:34
标题: 请教!如何将表导出到另个带密码的数据库中?
    DoCmd.TransferDatabase acExport, "Microsoft Access", "D:\备份.mdb", acTable, "表", "表8", False
备份.mdb设置了密码123456,在哪加参数啊?


作者: tmtony    时间: 2012-12-23 12:07
试试这个: DoCmd.TransferDatabase LinkType, "ODBC 数据库", "ODBC;DSN=" & DSNStr & ";SERVER=" & IPStr & ";DATABASE=" & DSNStr & ";UID=" & ODBCUser & "WD=" & ODBCPass, acTable, TableName, TableName, False, True

http://www.office-cn.net/forum.p ... base%2B%C3%DC%C2%EB
作者: sxgaobo    时间: 2012-12-23 12:43
本帖最后由 sxgaobo 于 2012-12-23 12:45 编辑

搞定。谢谢tmtony   andymark !!!
   Dim db As Database
    Dim strPath As String
    strPath = "D:\备份.mdb"
    Set db = DBEngine.Workspaces(0).OpenDatabase(strPath, False, False, "MS Access;pwd=123456")
    DoCmd.TransferDatabase acExport, "Microsoft Access", strPath, acTable, "表", "表8", False
    db.Close
    Set db = Nothing





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