Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Populate Datagrid control

Populate Datagrid control

Scheduled Pinned Locked Moved Visual Basic
databasehelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tatchung
    wrote on last edited by
    #1

    Hi, Im having trouble populating my datagrid control from an ms access database. 1st method I used was through ADODC control and it worked fine. Then I just found a way to lessen the code by creating a class then passing variables through a module. Anyways using the class method my datagrid does not show any data at all. I've removed the datasource control and debugged the program...record count shows that it did get something. Im just in the dark why it won't populate in my datagrid. By the way I'm using vb6 and datagrid through common control 6.0. populate datagrid

    clsPubConnection.GetQuery rs1, "insert query here", 1, 1
    Set dgd1.DataSource = rs1
    dgd1.Refresh

    code inside the class

    If rs.State = 1 Then rs.Close
    With rs
    .CursorType = intCursorType
    .LockType = intLockType
    .ActiveConnection = cn
    .Source = strSqlCommand
    .Open
    End With

    Any help would be greatly appreciated. Thanks in advance :-D

    Aim small, miss small

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups