how do i populate datagrid from a recordset object
how do i populate datagrid from a recordset object in visual basic 6.0
dim cnSrch as ADODB.Connection
Dim rsSrch As ADODB.Recordset
Set cnSrch = New ADODB.Connection
cnSrch.ConnectionString = "provider=microsoft.jet.oledb.4.0;" &
"Data Source = C:\BB\sh.mdb"
cnSrch.Open
Set rsSrch = New ADODB.Recordset
Dim findstr As String
findstr = "select * from PatientTab where CardType = '" & cboCardType & "'"
rsSrch.Open findstr, cnSrch, adOpenDynamic
Set DataGrid1.DataSource = rsSrch
DataGrid1.Refresh
|