Computing.Net > Forums > Programming > Datagrid without using Adodc (vb6)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Datagrid without using Adodc (vb6)

Reply to Message Icon

Name: Anthony Arde
Date: March 8, 2005 at 04:56:12 Pacific
OS: winxp pro sp2
CPU/Ram: 386mb ram p3 733
Comment:

Ok i`m currently connected to a sql database
and i want to display some info from there into a datagrid without using Adodc, please help thanks Ant.



Sponsored Link
Ads by Google

Response Number 1
Name: Chi Happens
Date: March 9, 2005 at 09:45:32 Pacific
Reply:

use adodb connection and recordset and build the grid yourself.

If you don't need all the "special" functonality of the data grid (namely the bold lines between each cell and the ability to know which cell you are editing) then use a listview in detail mode with gridlines on.

both items work about the same

Dim CN as ADODB.Connection
DIM RS as ADODB.RecordSet
Dim NewItem as ListItem

Set CN = New ADODB.Connection
Set RS = New ADODB.RecordSet

CN.Open "DSN=DataServiceName" ' or complete connection string

RS.OPen "SELECT * FROM MYTABLE",CN
Do While Not RS.EOF

Set NewItem = ListView1.Items.Add()
NewItem.Text = RS("SOMEFIELD")
NewItem.ListSubItems.Add(RS("SOMEOTHERFIELD"))

RS.MoveNext
Loop
RS.Close
CN.Close

Set RS = Nothing 'vitally important for memory leaks avoidance
Set CN = Nothing 'same

Hope This Helps,
Chi

They mostly come at night...mostly


0
Reply to Message Icon

Related Posts

See More


Printing a form Snmp module using Winsnmp



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Datagrid without using Adodc (vb6)

without using ODBC www.computing.net/answers/programming/without-using-odbc/546.html

print without using printf www.computing.net/answers/programming/print-without-using-printf/18429.html

print without using printf www.computing.net/answers/programming/print-without-using-printf/18438.html