Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.

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 ListItemSet CN = New ADODB.Connection
Set RS = New ADODB.RecordSetCN.Open "DSN=DataServiceName" ' or complete connection string
RS.OPen "SELECT * FROM MYTABLE",CN
Do While Not RS.EOFSet NewItem = ListView1.Items.Add()
NewItem.Text = RS("SOMEFIELD")
NewItem.ListSubItems.Add(RS("SOMEOTHERFIELD"))RS.MoveNext
Loop
RS.Close
CN.CloseSet RS = Nothing 'vitally important for memory leaks avoidance
Set CN = Nothing 'sameHope This Helps,
ChiThey mostly come at night...mostly

![]() |
Printing a form
|
Snmp module using Winsnmp
|

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