Hi please how can I resolve this issue?
"Compiler error"
The code in this project must be updated for use on 64-bit systems.
Please review and update Declare Statements and then mark them with the PtrSafe attribute.
--------------------------------------------------------------------------------------------------
This is my original code that is generating this error:
'Revised Type Declare for compatability with NT
Type tagOPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As Long
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
Flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As Long
End Type
Private Declare Function GetOpenFileName Lib "comdlg32.dll" _
Alias "GetOpenFileNameA" (OPENFILENAME As tagOPENFILENAME) As Long
Private Sub HandleError(strLoc As String, strError As String, intError As Integer)
MsgBox strLoc & ": " & strError & " (" & intError & ")", 16, "CheckTableLinks"
End Sub
Private Function TableLinkOkay(strTableName As String) As Boolean
'Function accepts a table name and tests first to determine if linked
'table, then tests link by performing refresh link.
'Error causes TableLinkOkay = False, else TableLinkOkay = True
Dim CurDB As DAO.Database
Dim tdf As TableDef
Dim strFieldName As String
On Error GoTo TableLinkOkayError
Set CurDB = DBEngine.Workspaces(0).Databases(0)
Set tdf = CurDB.TableDefs(strTableName)
TableLinkOkay = True
If tdf.Connect <> "" Then
strFieldName = tdf.Fields(0).Name 'Do not test if nonlinked table
End If
TableLinkOkay = True
TableLinkOkayExit:
Exit Function
TableLinkOkayError:
TableLinkOkay = False
GoTo TableLinkOkayExit
End Function
"Compiler error"
The code in this project must be updated for use on 64-bit systems.
Please review and update Declare Statements and then mark them with the PtrSafe attribute.
--------------------------------------------------------------------------------------------------
This is my original code that is generating this error:
'Revised Type Declare for compatability with NT
Type tagOPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As Long
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
Flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As Long
End Type
Private Declare Function GetOpenFileName Lib "comdlg32.dll" _
Alias "GetOpenFileNameA" (OPENFILENAME As tagOPENFILENAME) As Long
Private Sub HandleError(strLoc As String, strError As String, intError As Integer)
MsgBox strLoc & ": " & strError & " (" & intError & ")", 16, "CheckTableLinks"
End Sub
Private Function TableLinkOkay(strTableName As String) As Boolean
'Function accepts a table name and tests first to determine if linked
'table, then tests link by performing refresh link.
'Error causes TableLinkOkay = False, else TableLinkOkay = True
Dim CurDB As DAO.Database
Dim tdf As TableDef
Dim strFieldName As String
On Error GoTo TableLinkOkayError
Set CurDB = DBEngine.Workspaces(0).Databases(0)
Set tdf = CurDB.TableDefs(strTableName)
TableLinkOkay = True
If tdf.Connect <> "" Then
strFieldName = tdf.Fields(0).Name 'Do not test if nonlinked table
End If
TableLinkOkay = True
TableLinkOkayExit:
Exit Function
TableLinkOkayError:
TableLinkOkay = False
GoTo TableLinkOkayExit
End Function