View Single Post
  #1 (permalink)  
Old September 22nd, 2004, 11:18 AM
bisigreat bisigreat is offline
Authorized User
Points: 79, Level: 1
Points: 79, Level: 1 Points: 79, Level: 1 Points: 79, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to bisigreat
Default How do i populate datagrid from a recordset object

I need to populate a datagrid from this search criteriaDim 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