Assigning a Dao.Recordset to a Datacontrol With VB6 SP4 and Dao.360 
Author Message
 Assigning a Dao.Recordset to a Datacontrol With VB6 SP4 and Dao.360

I'm having trouble to set the recordset property of a datacontrol in a VB6
form with a Dao.Recordset Object.
infact after executing the following code
    Set me.data1.recordset = myrecordset
the datacontrol's recordset property is still set to nothing.

With SP3 of VB6 there was no problem.



Thu, 31 Jul 2003 01:16:04 GMT  
 Assigning a Dao.Recordset to a Datacontrol With VB6 SP4 and Dao.360
Hi Mauro,

I can not reproduce the problem you described in VB6 sp4. I have tried the
following code and it works as intended.

1. New a VB project.
2. In Form1, put a Data control named Data1 and a CommandButton control
named Command1.
3. Put the following code in the Form1 module. (BIBLIO.MDB is the sample
database shipped with VB6)

Dim Db As Database, Rs As Recordset  
Private Sub Command1_Click()
   Set Db = Workspaces(0).OpenDatabase("D:\Program Files\Microsoft Visual
Studio\VB98\BIBLIO.MDB")
   Set Rs = Db.OpenRecordset("AUTHORS")
   Set Data1.Recordset = Rs  
   Data1.Recordset.Index = "PrimaryKey"
   MsgBox Data1.Recordset.Fields(1)
End Sub

After executing the program, when i click Command1 button, it shows the
data as intended.

Can the simple code above run correctly on your machine?

Best Regards,
Elan



Fri, 01 Aug 2003 09:55:58 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DAO 360 Help Files

2. Set Datacontrol recordset with DAO 3.6

3. Problems assigning a DAO-recordset to a data control - Need help

4. DAO Recordset.LastUpdated in DAO

5. DAO 3.6 vs DAO 3.5 (VB6.0 sp3)

6. VB6: DAO recordsets

7. how do i assign recordsets to a datacontrol

8. Assigning Recordset created with ADO to VB5 DataControl ?

9. how do i assign recordsets to a datacontrol

10. Filling a datagrid with DAO (no datacontrol object)

11. DAO or DATACONTROL?

12. What EXACTLY is the difference between DAO and DataControl

 

 
Powered by phpBB® Forum Software