p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET Website Programming Problem-Design-Solution (http://p2p.wrox.com/forumdisplay.php?f=23)
-   -   How do i populate datagrid from a recordset object (http://p2p.wrox.com/showthread.php?t=18783)

bisigreat September 22nd, 2004 11:18 AM

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





bmains September 22nd, 2004 11:35 AM

System.Data.OleDb also has access to MSAccess...


All times are GMT -4. The time now is 05:39 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.