Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 April 28th, 2007, 07:13 PM
Authorized User
 
Join Date: Sep 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Populating DataGrid

Can someone please help, The DataGrid(grdStaff) is not being populated with the recordset from database


Dim sql As String

Dim r As New ADODB.Recordset


Set r = New ADODB.Recordset

sql = "SELECT Username, Password from Admin"

With r
.Open sql, cnn, adOpenKeyset, adLockOptimistic, adCmdText
Set grdStaff.DataSource = r

End With

End Sub







Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: DATAGRID POPULATING emeka VB Databases Basics 0 April 28th, 2007 08:06 PM
Populating datagrid thru command outlaw C# 0 August 19th, 2006 05:55 AM
Populating dropdown within a datagrid ninel ASP.NET 2.0 Professional 2 May 31st, 2006 02:41 AM
Populating dropdown within a datagrid ninel ASP.NET 2.0 Basics 7 May 26th, 2006 03:26 PM
Populating dropdown within a datagrid ninel General .NET 0 May 26th, 2006 12:27 PM





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