Private Sub btnHideTables_Click() Dim tdf As Object Const dbHiddenObject = 1 For Each tdf In CurrentDb.TableDefs tdf.Attributes = dbHiddenObject Next End Sub Private Sub btnHideTables_Click() Dim tdf As Object For Each tdf In CurrentDb.TableDefs tdf.Attributes = 0 Next End Sub |
Dim strConn As String strConn = "ODBC;DRIVER=SQL Server;SERVER=192.168.1.1;UID=你的用户名; PWD=你的密码;DATABASE=你的数据库名称" DoCmd.TransferDatabase acLink, "ODBC", strConn, acTable, "表1", "表1" |
Private Sub btnLogin_Click() Dim strConn As String strConn = "ODBC;DRIVER=SQL Server;SERVER=192.168.1.1;UID=你的用户名; PWD=你的密码;DATABASE=你的数据库名称" Set dbs = DBEngine.OpenDatabase("", False, False, strConn) dbs.Close '其它登录处理代码 End Sub |
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) | Powered by Discuz! X3.3 |