Please I want to know can I join the tools like text box, Label, List, combo box and data grid with sql statements in direct code
e.g if I want to display data from database in one of the previous tools how can I get it
GeoffS Level: VB Lord Registered: 29-09-2004 Posts: 536
Re: sql query in VB Direct code
Hi,
You can bind the controls to your Recordset object :
Set Text1.DataSource = Rscn
Text1.DataField = "name_of_field_to_display"
Create the Recordset in your Form_Load Event rather than the Command1_Click, then bind the controls and set the Recordset to the beginning (Rscn.MoveFirst). Then if you use the Command1_Click to move forward through the Recordset (Rscn.MoveNext) you will see the contents of your controls change. You could put a second button to move back (Rscn.MovePrevious).
____________________________ multi-tasking - the ability to hang more than one app. at the same time.