|
-
Jun 27th, 2001, 09:54 AM
#1
Thread Starter
Lively Member
problems with closing a recordset
i have a recordset in which i close the connection and then i open an access application. i have tried everything from using a seperate connectionvariable and closing the connection and the database to using just a recordset and closing it to halting the program so that the .ldb file disappears. has anyone had this problem before? any suggestions? (even though i probably tried them all)
thanbks, PJ
-
Jun 27th, 2001, 10:32 AM
#2
There are a couple of things that come to mind.
The main one is completely flushing out the reference to the connection and memory the variable takes up by setting it to nothing after you close it :
Conn.close
Set Conn = nothing
Can we see your current coding for this part though please ?
-
Jun 27th, 2001, 11:53 AM
#3
Thread Starter
Lively Member
yes, i have tired that also. here is my code. i am working on a bigger scale program, this is just a portion of it.
Public acc_app As Access.Application
Public rst As ADODB.Recordset
Public conn As ADODB.Connection
Private Sub Command1_Click()
Set rst = New ADODB.Recordset
Set conn = New ADODB.Connection
rst.Source = "T1"
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\kulickpj\My Documents\electronic_forms.mdb;Persist Security Info=False"
rst.ActiveConnection = conn
rst.LockType = adLockOptimistic
rst.CursorType = adOpenStatic
rst.Open Options:=adCmdTable
End Sub
Private Sub Command2_Click()
rst.Close
Set rst = Nothing
conn.Close
Set conn = Nothing
Set acc_app = New Access.Application
acc_app.OpenAccessProject "C:\Documents and Settings\kulickpj\My Documents\electronic_forms.mdb"
acc_app.Visible = True
End Sub
i made up this little project to simulate what is happening in my big project and i still get the same error. basically, the rst will be opened first when you click on command1, then you will click on command2 and i get the error that access can't open the file because it is missing or being used exclusively by another user.
thanks, PJ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|