|
-
Jul 31st, 2006, 09:49 AM
#1
Thread Starter
Addicted Member
can I open two recordsets at the same time?
or do I need to close one, then open the other?
Last edited by GenocideOwl; Jul 31st, 2006 at 12:51 PM.
-
Jul 31st, 2006, 09:55 AM
#2
Re: can I open two recordsets at the same time?
 Originally Posted by GenocideOwl
or do I need to close one, then open the other?
Oh sure. You could open 50 recordsets at the same time, although I have no idea why you would.
You do, however, need to give them different names.
VB Code:
Option Explicit
Private rsOwl As ADODB.Recordset
Private rsHack As ADODB.Recordset
-
Jul 31st, 2006, 10:01 AM
#3
Hyperactive Member
Re: can I open two recordsets at the same time?
you can also use multiple recordset but microsoft jet doesnt support them
-
Jul 31st, 2006, 10:07 AM
#4
Thread Starter
Addicted Member
Re: can I open two recordsets at the same time?
so, since I am using MSjet, I can't open two at once?
-
Jul 31st, 2006, 10:15 AM
#5
Hyperactive Member
Re: can I open two recordsets at the same time?
you can declare two recordset like hack did but declaring 1 recordset and opening it with multiple queries is not supported by MSjet
eg:
rs.Open "SELECT * FROM table1 ;SELECT * FROM table2"
-
Jul 31st, 2006, 10:16 AM
#6
Thread Starter
Addicted Member
Re: can I open two recordsets at the same time?
so I couldn't do say
VB Code:
Set cn = New ADODB.Connection 'we've declared it as a ADODB connection lets set it.
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= " & App.Path & "\CRTInventory.mdb" 'this is the connection string explained in the notes section.
cn.Open
Set rs = New ADODB.Recordset 'as we did with the connection
rs.Open bargeDB, cn, adOpenKeyset, adLockPessimistic, adCmdTable
rs2.Open "CRTInventory", cn, adOpenKeyset, adLockPessimistic, adCmdTable
-
Jul 31st, 2006, 10:19 AM
#7
Hyperactive Member
Re: can I open two recordsets at the same time?
you can open recordset as many as you want using one connection
dim rs as adodb.recordset
dim rs2 as adodb.recordset
Set rs = New ADODB.Recordset
Set rs2 = New ADODB.Recordset
rs.Open bargeDB, cn, adOpenKeyset, adLockPessimistic, adCmdTable
rs2.Open "CRTInventory", cn, adOpenKeyset, adLockPessimistic, adCmdTable
-
Jul 31st, 2006, 10:36 AM
#8
Thread Starter
Addicted Member
Re: can I open two recordsets at the same time?
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
|