1
MS Access 2003의 응용 프로그램 아이콘 경로에 프로그래밍 방식으로 어떻게 액세스합니까?MS Access의 응용 프로그램 아이콘 경로
MS Access 2003의 응용 프로그램 아이콘 경로에 프로그래밍 방식으로 어떻게 액세스합니까?MS Access의 응용 프로그램 아이콘 경로
데이터베이스 개체의 사용자 지정 속성 ("AppIcon")입니다.
Set dbs = CurrentDb
sAppIconPath = dbs.Properties("AppIcon")
주 - 속성이 존재하지 않으면 오류가 발생합니다.
예
다음 예는 Microsoft Access 데이터베이스 (.mdb)에 AppIcon 및 AppTitle 속성을 변경하는 방법을 보여줍니다
액세스 도움말에서이 코드는 속성을 만드는 방법을 보여줍니다. 속성을 아직 설정하거나 만들지 않은 경우 CreateProperty 메서드를 사용하여 속성을 만들어 속성 컬렉션에 추가해야합니다.
Sub cmdAddProp_Click()
Dim intX As Integer
Const DB_Text As Long = 10
intX = AddAppProperty("AppTitle", DB_Text, "My Custom Application")
intX = AddAppProperty("AppIcon", DB_Text, "C:\Windows\Cars.bmp")
CurrentDb.Properties("UseAppIconForFrmRpt") = 1
Application.RefreshTitleBar
End Sub
Function AddAppProperty(strName As String, _
varType As Variant, varValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo AddProp_Err
dbs.Properties(strName) = varValue
AddAppProperty = True
AddProp_Bye:
Exit Function
AddProp_Err:
If Err = conPropNotFoundError Then
Set prp = dbs.CreateProperty(strName, varType, varValue)
dbs.Properties.Append prp
Resume
Else
AddAppProperty = False
Resume AddProp_Bye
End If
End Function