or do I need to close one, then open the other?
or do I need to close one, then open the other?
Last edited by GenocideOwl; Jul 31st, 2006 at 12:51 PM.
Oh sure. You could open 50 recordsets at the same time, although I have no idea why you would.Originally Posted by GenocideOwl
You do, however, need to give them different names.VB Code:
Option Explicit Private rsOwl As ADODB.Recordset Private rsHack As ADODB.Recordset
Please use [Code]your code goes in here[/Code] tags when posting code.
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.
Creating A Wizard In VB.NET
Paging A Recordset
What is wrong with using On Error Resume Next
Good Article: Language Enhancements In Visual Basic 2010
Upgrading VB6 Code To VB.NET
Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked
you can also use multiple recordset but microsoft jet doesnt support them
so, since I am using MSjet, I can't open two at once?
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"
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
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
ok, thanks