ERROR
When renaming an object in ArcCatalog, the following error message appears:
"Failed to rename selected object(s)
[Invalid characters in the object name]"
Depending on what is being renamed, the message may also contain one of the following phrases:
"The table name is invalid
The dataset name is invalid
The topology name is invalid"
The new name of the object contains characters that the underlying database considers invalid. The list of invalid characters differs depending on the database.
Code:
Public Sub GetInvalidCharacters()
Dim pApp As IGxApplication
Dim pGxObj As IGxObject
Dim pGxDB2 As IGxDatabase2
Dim pSDEWS As IWorkspace
Dim pSQLSyntax As ISQLSyntax
Dim strInvalidChr As String, strStartingInvalidChr As String
Set pApp = Application
Set pGxObj = pApp.SelectedObject
If TypeOf pGxObj Is IGxDataset Then Set pGxObj = pGxObj.Parent
'If for some reason we're not connected to a GDB, Exit
If Not TypeOf pGxObj Is IGxDatabase2 Then Exit Sub
Set pGxDB2 = pGxObj
Set pSDEWS = pGxDB2.workspace
Set pSQLSyntax = pSDEWS 'QI
strStartingInvalidChr = pSQLSyntax.GetInvalidStartingCharacters
strInvalidChr = pSQLSyntax.GetInvalidCharacters
MsgBox "Invalid Starting Characters: " & strStartingInvalidChr & vbCrLf & "Invalid Characters: " & strInvalidChr
End Sub
Get help from ArcGIS experts
Download the Esri Support App