You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am taking over an old Access database. Tablesnames have ' and & characters in them.
Exporping fails in line If Application.GetHiddenAttribute(contType, doc.Name) Then
in clsDbHiddenAttribute when doc.Name has a &.
Maybe something like this helps (not my code, but our favorites AI's):
Function EscapeObjectName(objectName As String) As String
Dim safeName As String
Dim i As Integer
Dim c As String
Dim specialCharacters As String
' Define special characters that need escaping
specialCharacters = "~`!@#$%^&*()-+=|\/{}[]:;'<>,.?/ "
' Check if the name contains any special characters
For i = 1 To Len(objectName)
c = Mid(objectName, i, 1)
If InStr(specialCharacters, c) > 0 Then
' If it contains special characters, escape the whole name
EscapeObjectName = "[" & objectName & "]"
Exit Function
End If
Next i
' If no special characters are found, return the original name
EscapeObjectName = objectName
End Function
'example usage:
Sub TestEscapeObjectName()
Dim unsafeName As String
Dim safeName As String
unsafeName = "Table&Name"
safeName = EscapeObjectName(unsafeName)
Debug.Print "Original Name: " & unsafeName
Debug.Print "Safe Name: " & safeName
' Example usage in a query
Dim sql As String
sql = "SELECT * FROM " & safeName
Debug.Print "SQL: " & sql
' Example usage in checking hidden attribute
Dim isHidden As Boolean
isHidden = Application.GetHiddenAttribute(acTable, safeName)
Debug.Print "Is Hidden: " & isHidden
End Sub
The text was updated successfully, but these errors were encountered:
I am having difficulty reproducing this issue... I created a table named tblSpecial '&' Name, set the hidden attribute, and it exported just fine for me. I have a couple follow-up questions:
Which version of the add-in are you using? (i.e. 4.0.36)
Do you have anything special in the locale/language settings for your computer?
Could you upload a small example database demonstrating the issue?
a) Version 4.0.34
b) no special settings that I know of (windows and office: German)
c) I am not sure if I can do this. I will see and maybe reply again.
I am taking over an old Access database. Tablesnames have ' and & characters in them.
Exporping fails in line
If Application.GetHiddenAttribute(contType, doc.Name) Then
in clsDbHiddenAttribute when doc.Name has a &.
Maybe something like this helps (not my code, but our favorites AI's):
The text was updated successfully, but these errors were encountered: