C
Chris Burnette
I am trying to open a persistent Recordset object and set the CacheSize
property using VBA. I do this in the Form_Open event, but every time I try
to do it I get the message "this property is read-only and can't be set."
Before I run this code, I have the user login via a form which prompts for a
username and password and then uses a DSN-less connection string to connect
to an MSDE back-end.
My code is below:
Option Compare Database
Public rst As Recordset
Public db As DAO.Database
Private Sub Form_Close()
rst.Close
Set rst = Nothing
End Sub
Private Sub Form_Open(Cancel As Integer)
Set db = CurrentDb()
Set rst = db.OpenRecordset("Select * FROM EntireSpreadsheet",
dbOpenDynaset, dbSeeChanges)
rst.CacheSize = 30
'Me.Visible = False
End Sub
I am not sure why I am getting this error, and my main reason for wanting to
do this is to improve the performance of the database. If anyone has any
ideas as to why I might be getting this message, I'd love to hear them.
Thanks,
Chris
property using VBA. I do this in the Form_Open event, but every time I try
to do it I get the message "this property is read-only and can't be set."
Before I run this code, I have the user login via a form which prompts for a
username and password and then uses a DSN-less connection string to connect
to an MSDE back-end.
My code is below:
Option Compare Database
Public rst As Recordset
Public db As DAO.Database
Private Sub Form_Close()
rst.Close
Set rst = Nothing
End Sub
Private Sub Form_Open(Cancel As Integer)
Set db = CurrentDb()
Set rst = db.OpenRecordset("Select * FROM EntireSpreadsheet",
dbOpenDynaset, dbSeeChanges)
rst.CacheSize = 30
'Me.Visible = False
End Sub
I am not sure why I am getting this error, and my main reason for wanting to
do this is to improve the performance of the database. If anyone has any
ideas as to why I might be getting this message, I'd love to hear them.
Thanks,
Chris