Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 23rd, 2004, 03:55 AM
Authorized User
 
Join Date: Aug 2004
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

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




The Following User Says Thank You to bisigreat For This Useful Post:
 
Old August 6th, 2009, 04:30 AM
Registered User
 
Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sir,
how can i populate records from a table to data grid,plz give me code





Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate combobox from ADO recordset - RESOLVED! robzyc Access VBA 8 May 23rd, 2008 01:07 AM
Populate unbound form with recordset pacg Access VBA 2 September 26th, 2005 06:06 PM
How do i populate datagrid from a recordset object bisigreat BOOK: ASP.NET Website Programming Problem-Design-Solution 1 September 22nd, 2004 11:35 AM
populate data from Access Table into datagrid bisigreat VB How-To 6 August 17th, 2004 06:58 AM
using fields in recordset to populate textbox stoneman Access 2 October 7th, 2003 11:03 AM





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