Форумы HiProg.com - MS ACCESS, VBA, VB

 

Ответить на сообщение

Вернуться к теме

Вы отвечаете на сообщение:

ник: Силblч

Guid Property
See AlsoApplies ToExampleSpecifics
The GUID property of a Reference object returns a GUID 
that identifies a type library in the Windows Registry. Read-only String.

expression.Guid
expression    
Required. An expression that returns one of the objects in the Applies To list.

Remarks
The GUID property is available only by using Visual Basic.

Every type library has an associated GUID which is stored in the Registry. 
When you set a reference to a type library, Microsoft Access uses the type library's 
GUID to identify the type library.

You can use the AddFromGUID method to create a Reference object from a type library's GUID.

Example
The following example prints the value of the FullPath, GUID, IsBroken, 
Major, and Minor properties for each Reference object in the References collection:

Sub ReferenceProperties()
    Dim ref As Reference

    ' Enumerate through References collection.
    For Each ref In References
        ' Check IsBroken property.
        If ref.IsBroken = False Then
            Debug.Print "Name: ", ref.Name
            Debug.Print "FullPath: ", ref.FullPath
            Debug.Print "Version: ", ref.Major & "." & ref.Minor
        Else
            Debug.Print "GUIDs of broken references:"
            Debug.Print ref.GUID
        EndIf
    Next ref
End Sub
        






Public Sub StringValueOfGUID()

    Dim ctl As Control
    Dim strGUID As String

    ' Get the GUID.
    Set ctl = Forms!Employees!s_GUID
    Debug.Print TypeName(ctl.Value)

    ' Convert the GUID to a string.
    strGUID = StringFromGUID(ctl.Value)
    Debug.Print TypeName(strGUID)

End Sub

Sub CheckGUIDType()

    Dim dbsConn As ADODB.Connection
    Dim rstEmployees As ADODB.Recordset

    ' Make a connection to the current database.
    Set dbsConn = Application.CurrentProject.Connection
    Set rstEmployees = New ADODB.Recordset
    rstEmployees.Open "Employees", dbsConn, , , adCmdTable

    ' Print the GUID to the immediate window.
    Debug.Print rst!s_GUID
    Debug.Print TypeName(rst!s_GUID)
    Debug.Print TypeName(GuidFromString(rst!s_GUID))

    Set rstEmployees = Nothing
    Set dbsConn = Nothing

End Sub


Ваше имя:

Пароль:

Цитировать: [quote][/quote] Код: [code][/code]
Жирный: [b][/b] Наклонный: [i][/i]
URL: [url][/url] 

Сообщение:

 Размер файла не более 50 Кбт. Большие файлы можно размещать на www.slil.ru

Прикрепить:

 

Для вставки смайлов в текст щелкните по значку.