Message 1 of 7
VBA connection ms.access vs AutoCAD (subscript out of range)

Not applicable
03-29-2019
05:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In the past i was allways use this vba file to make connection to ms.access database.
But on some reason it give me now connection error with "subscript out of range"
Private Sub Class_Initialize()
On Error GoTo errInit
Set adoConnection = New ADODB.Connection
Set adoRC = New ADODB.Recordset
With adoConnection
.Open "Provider=Microsoft.JET.OLEDB.12.0;Data Source=" & "E:\TEST\Info64.accdb"
End With
On Error Resume Next
ThisDrawing.SelectionSets("KADER").Delete
Set objSSet = ThisDrawing.SelectionSets.Add("KADER")
Exit Sub
errInit:
MsgBox err.Description, vbCritical, "Ado Connection"
Set adoConnection = Nothing
Set adoRC = Nothing
err.Raise err.Number, Me, err.Description