Where is dynaset?

  • Thread starter Thread starter George Hester
  • Start date Start date
No. A DynaSet is a type of RecordSet. As the code in the link to which you
referred shows:

Sub dbOpenDynasetX()

Dim dbsNorthwind As Database
Dim rstInvoices As Recordset
Dim fldLoop As Field

Set dbsNorthwind = OpenDatabase("Northwind.mdb")
Set rstInvoices = dbsNorthwind.OpenRecordset("Invoices", dbOpenDynaset)

'snip the other stuff
End Sub

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

According to Microsoft it is in DAO 3.60.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/office97/ht
ml/output/F1/D2/S5A29F.asp

But it is Not.

Anyone know where it is so that:

Dim dyn As Dynaset makes sense? Thanks.

http://support.microsoft.com/default.aspx?scid=kb;en-us;104155&Product=vbb
 
I don't know. I just figured I could implement the example as was given in my last link. I guess not. Thanks.
 
Well, I learn something new every day! I still work with a large 2.0
database and had no idea that one could Dim a dynaset! I still use:

Set MyRS = MyDB.OpenRecordset("tblWhatever", DB_OPEN_DYNASET)

regards,

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Oh. The example was using the old biblio.mdb and it did have the reference:

Dim ds as dynaset I asked about. Oh well I thought maybe I could do what it
had as written even with Access 10. Seems I have to find the Access 2.0
Object Library.

http://support.microsoft.com/default.aspx?scid=kb;en-us;104155&Product=vbb
 
Thank you Cheryl. I changed the exanple to:

Dim ds As Recordset 'as dynaset
Set ds = db.OpenRecordset("publishers", dbOpenDynaset) ' ..CreateDynaset(tmp$)

But I still don't think that's right. For I am not using tmp$ the Query_Array(idx%).
 
Jeeze I tried that. Like so:

Dim db As Database
Dim ds As Recordset 'as dynaset
idx% = List1.ListIndex
tmp$ = query_array(idx%)
Set ds = db.OpenRecordset(tmp$, dbOpenDynaset) ' ..CreateDynaset(tmp$)

And VB6 hung. I think I need to use QueryDef in some fashion. Because right now with

Set ds = db.OpenRecordset("publishers", dbOpenDynaset) ' ..CreateDynaset(tmp$)

all the Queries give the same result. Coinsidering:

Dim qdef As QueryDef
Set qdef = db.CreateQueryDef(tmp$)

but not sure how to implement this. I doubt:

Set ds = db.OpenRecordset(qdef, dbOpenDynaset) ' ..CreateDynaset(tmp$)

as the first parameter must be a string.
 
George,

Are you trying to get the selected value from a ListBox and use it as a
selection criterion in the recordset? If so, and presuming that you are
doing this from within Access, would this construct work?

Dim strListSel as string
Dim db as database
dim ds as recordset
dim strSQL as string

strListSel = Me.List1
strSQL = "Select * from Publishers where [SomeTextField] = " & Chr(34) &
strListSel & Chr(34)

Set ds = db.OpenRecordset(strSQL, dbOpenDynaset)


--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Thank you Cheryl. I changed the exanple to:

Dim ds As Recordset 'as dynaset
Set ds = db.OpenRecordset("publishers", dbOpenDynaset) '
..CreateDynaset(tmp$)

But I still don't think that's right. For I am not using tmp$ the
Query_Array(idx%).
 
Back
Top