error 3048 monitor resources in vba

C

carbra

The error 3048 indicate to many open databases (recordsets) in an vba
project. Eventhough I have done the suggestions from Alex Dybenko with public
declare dbs as DAO.database at set dbs = currentDB in every subs I get the
error message.
Is there a way to monitor the resources in an application window so I know
when to stop building up objects in an project. I hope some one has an
suggestion. Thanks in adv.
 
D

Dennis

Are you closing the recordsets (and uninstantiating the recordset variable)
each time you're finished with a lookup?
 
C

carbra

Dear Dennis,
The recordset is closing each time, but I do not "set dbs to nothing" each
time. Is that important?? My code is each time like the following with change
in table name.
'Dim dbs As DAO.Database declared as public elswere
Set dbs = CurrentDb
Dim rsCpr As Recordset
Set rsCpr = dbs.OpenRecordset("CPR", DB_OPEN_DYNASET)
rsCpr.AddNew
rsCpr!CPRnr = Me.CPR
rsCpr!Mod11ok = Mod11ok '*** checking ID
rsCpr!UserCreated = acbNetworkUserName
rsCpr!DateCreated = Now()
rsCpr.UpDate
rsCpr.Close
Is there a way to show available RAM for executing codes.
Thank for your comment, Dennis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Error 3048: Too many databases open 4
Run-time error 3048 0
Error 3048 4
VSTO C# add in Outlook.Appointment error 0
VBA Error Handling 4
Error 429 in Runtime 0
Qualifier Must Be Collection 1
VBA Code Help 3

Top