[AccessD] Operation Not Supported...
fuller.artful at gmail.com
Sun Oct 16 08:26:28 CDT 2022
I added an error handler, which gives the same result as I mentioned:
Error 3251: Operation is not supported for this type of object.
In the code I provided, there is a comment on the line above the errant
On Sun, Oct 16, 2022 at 7:35 AM John Colby <jwcolby at gmail.com> wrote:
> Is it a compile error or a run time error? You always need an error
> handler. On Error Goto ErrorLabel as the first line of the sub. Then
> somewhere down below an error label, usually as the last line of the sub.
> See the example (actual code form a class).
> Now when a run time error occurs the execution vectors to the error handler
> and you can see what it was and even "resume 0" to go execute the line with
> the error again.
> Private Sub Class_Initialize()
> On Error GoTo Err_Class_Initialize
> assDebugPrint "initialize " & mcstrModuleName, DebugPrint
> Set mclsGlobalInterface = New clsGlobalInterface
> Exit Sub
> MsgBox Err.Description, , "Error in Sub
> Resume Exit_Class_Initialize
> Resume 0 '.FOR TROUBLESHOOTING
> End Sub
> On Sun, Oct 16, 2022 at 7:02 AM Arthur Fuller <fuller.artful at gmail.com>
> > I'm a little puzzled by this error, especially since I copied the sub
> > Microsoft Learn.
> > <code>
> > Sub DatabaseObjectX()
> > Dim wrkAcc As Workspace
> > Dim dbsNorthwind As Database
> > Dim dbsNew As Database
> > Dim dbsLoop As Database
> > Dim prpLoop As Property
> > Set wrkAcc = CreateWorkspace("AccessWorkspace", "admin", _
> > "", dbUseJet)
> > ' Make sure there isn't already a file with the name of
> > ' the new database.
> > If Dir("NewDB.accdb") <> "" Then Kill "NewDB.accdb"
> > ' Create a new database with the specified
> > ' collating order.
> > Set dbsNew = wrkAcc.CreateDatabase("NewDB.accdb", _
> > dbLangGeneral)
> > Set dbsNorthwind = wrkAcc.OpenDatabase(CON_NorthwindPath &
> > "Northwind.accdb")
> > ' Enumerate the Databases collection.
> > For Each dbsLoop In wrkAcc.Databases
> > With dbsLoop
> > Debug.Print "Properties of " & .Name
> > ' Enumerate the Properties collection of each
> > ' Database object.
> > For Each prpLoop In .Properties
> > ' the line below causes the error
> > If prpLoop <> "" Then Debug.Print " " & _
> > prpLoop.Name & " = " & prpLoop
> > Next prpLoop
> > End With
> > Next dbsLoop
> > dbsNew.Close
> > dbsNorthwind.Close
> > wrkAcc.Close
> > End Sub
> > </code>
> > The error message says "Operation not supported for this type of object."
> > Any idea why?
> > --
> > Arthur
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> John W. Colby
> Colby Consulting
> AccessD mailing list
> AccessD at databaseadvisors.com
> Website: http://www.databaseadvisors.com
More information about the AccessD