|
-
Aug 1st, 2000, 11:09 AM
#1
Thread Starter
New Member
I am having trouble creating a disconnected recordset with ADO. The information I have seems to be incomplete. I open a connection, create a recordset, and when I try to use the ActiveConnection = Nothing it tells me that I can't as long as the database is open, but if I close the connection, it also gives me an error. Can someone help?
Thanks!
-
Aug 1st, 2000, 12:23 PM
#2
Hyperactive Member
post your code so the gurus here can have a look
-
Aug 1st, 2000, 01:12 PM
#3
Thread Starter
New Member
Here is the code that I have:
Set cnSQL = New ADODB.Connection
Set rstClaims = New ADODB.Recordset
With cnSQL
.ConnectionString = "Provider=Microsoft.JET.OLEDB.3.51;Data Source=" & xpath & "Spmedbk.mdb"
End With
cnSQL.Open
rstClaims.CursorType = adOpenStatic
rstClaims.Open "Select * FROM IN93010A", cnSQL, , adLockBatchOptimistic
Set rstClaims.ActiveConnection = Nothing
cnSQL.Close
Any help that you all can give me would be greatly appreciated. I am trying to connect to an Access Database that is on my computer (the path is xpath obviously).
-
Aug 1st, 2000, 01:38 PM
#4
Frenzied Member
For recordset usage, the activeconnection property can be changed until you open the recordset, at which point it becomes read-only.
-
Aug 1st, 2000, 03:13 PM
#5
Hyperactive Member
Code:
rstClaims.Open "Select * FROM IN93010A", cnSQL, , adLockBatchOptimistic
Try this:
Code:
dim rstClaims as New ADODB.Recordset
with rstClaims
.ActiveConnection = "Provider=Microsoft.JET.OLEDB.3.51;Data Source=" & xpath & "Spmedbk.mdb"
.CursorLocation = asOpenStatic
.LockType = adLockBatchOptimistic
.Source = "Select * FROM IN93010A"
.Open
end with
This should make closing everything easier:
Code:
Set adoRS.ActiveConnection = Nothing
-
Aug 2nd, 2000, 09:56 AM
#6
Thread Starter
New Member
Thanks compuGEEK!! It worked like a charm!!!!!!
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
|