MS Access VBA Error: Run time error '70' Permission Denied

后端 未结 3 1108
花落未央
花落未央 2020-11-28 12:15

I believe this issue is a result of a recent update to MS Office/Access or Windows 10. When I run this code:

Dim s As String
With CreateObject(\"Scriptlet.T         


        
3条回答
  •  情书的邮戳
    2020-11-28 12:51

    Since windows update taken out "Scriptlet.TypeLib", try the following:-

    Declare Function CoCreateGuid Lib "ole32" (ByRef GUID As Byte) As Long
    Public Function GenerateGUID() As String
        Dim ID(0 To 15) As Byte
        Dim N As Long
        Dim GUID As String
        Dim Res As Long
        Res = CoCreateGuid(ID(0))
    
        For N = 0 To 15
            GUID = GUID & IIf(ID(N) < 16, "0", "") & Hex$(ID(N))
            If Len(GUID) = 8 Or Len(GUID) = 13 Or Len(GUID) = 18 Or Len(GUID) = 23 Then
                GUID = GUID & "-"
            End If
        Next N
        GenerateGUID = GUID
    End Function
    

    Alternatively, if you are connecting to SQL Server 2008 or higher, try to use the SQL NEWID() function instead.

提交回复
热议问题