Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 28th, 2007, 09:06 PM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default RE: DATAGRID POPULATING

Can someone please help, The DataGrid(grdStaff) is not being populated with the recordset from database. When I move this code to a new VB project it works.

PS: I already have connection to the database. I am Using ADO


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


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 09:15 AM.


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