Office中国论坛/Access中国论坛

标题: 论坛坏了,贴不进去? [打印本页]

作者: KenjiSato    时间: 2003-4-8 17:55
标题: 论坛坏了,贴不进去?
怎么贴了N次都不行

作者: KenjiSato    时间: 2003-4-8 17:55
Function ap_LogOutCheck(strBackEndPath) As Integer
   
   On Error Resume Next
   ap_LogOutCheck = Dir(strBackEndPath & "\LogOut.FLG", vbHidden) = "LogOut.FLG"
   
End Function

Function ap_FormIsOpen(strFormName As String) As Integer

   Dim frmCurrent As Form
   
   For Each frmCurrent In Forms
      If frmCurrent.Name = strFormName Then
         ap_FormIsOpen = True
         Exit Function
      End If
   Next frmCurrent
   
End Function

Function ap_GetDatabaseProp(dbDatabase As Database, strPropertyName As String) As Variant
  
   ap_GetDatabaseProp = dbDatabase.Containers!Databases _
         .Documents("UserDefined").Properties(strPropertyName).Value
   
End Function
Sub ap_SetDatabaseProp(dbDatabase As Database, strPropertyName As String, varValue As Variant)
   
   dbDatabase.Containers!Databases.Documents("UserDefined").Properties(strPropertyName).Value = varValue

End Sub


Public Sub ap_LinkTables(dbLocal, dynSharedTables, strDataMDB As String)
   
    Dim tdfCurrent As TableDef
    Dim flgAddTable As Boolean
    Dim intTotalTbls As Integer
    Dim intCurrTbl As Integer
   
    On Error GoTo Err_LinkTables
   
    '-- Get the total number of linked tables, then display the progress meter.
    dynSharedTables.MoveLast
    intTotalTbls = dynSharedTables.RecordCount
    dynSharedTables.MoveFirst
   
    SysCmd acSysCmdInitMeter, "Linking Tables....", intTotalTbls
   
    intCurrTbl = 1
   
    Do Until dynSharedTables.EOF
            
        '-- Update the progress meter
        SysCmd acSysCmdUpdateMeter, intCurrTbl
        
        '-- Attempt to open the current link
        On Error Resume Next
        Set tdfCurrent = dbLocal.TableDefs(dynSharedTables!TableName)
        
        flgAddTable = Err.Number
        
        On Error GoTo Err_LinkTables
        
        '-- If there was an error, create the link from scratch,
        '-- otherwise, just update the connect string
        If flgAddTable Then
            
            Set tdfCurrent = dbLocal.CreateTableDef(dynSharedTables!TableName)
            tdfCurrent.SourceTableName = dynSharedTables!TableName
            tdfCurrent.Connect = ";DATABASE=" & strDataMDB
            CurrentDb.TableDefs.Append tdfCurrent
        
        Else
            
            tdfCurrent.Connect = ";DATABASE=" & strDataMDB
            tdfCurrent.RefreshLink
                    
        End If
                  
        dynSharedTables.MoveNext
        intCurrTbl = intCurrTbl + 1
        
    Loop
   
Exit_LinkTables:

    SysCmd acSysCmdRemoveMeter
   
    Exit Sub

Err_LinkTables:
   
    Resume Exit_LinkTables


End Sub
作者: KenjiSato    时间: 2003-4-8 17:56
Function ap_LogOutCheck(strBackEndPath) As Integer
   
   On Error Resume Next
   ap_LogOutCheck = Dir(strBackEndPath & "\LogOut.FLG", vbHidden) = "LogOut.FLG"
   
End Function

Function ap_FormIsOpen(strFormName As String) As Integer

   Dim frmCurrent As Form
   
   For Each frmCurrent In Forms
      If frmCurrent.Name = strFormName Then
         ap_FormIsOpen = True
         Exit Function
      End If
   Next frmCurrent
   
End Function

Function ap_GetDatabaseProp(dbDatabase As Database, strPropertyName As String) As Variant
  
   ap_GetDatabaseProp = dbDatabase.Containers!Databases _
         .Documents("UserDefined").Properties(strPropertyName).Value
   
End Function
作者: KenjiSato    时间: 2003-4-8 18:00
上传都不行?




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