Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datagrid empty

Status
Not open for further replies.

bbartlin

Programmer
Jan 8, 2004
35
US
Can anyone tell me why my datagrid has no rows? The query is definitely bringing back data because I can MsgBox the rst!field1

SQL = "SELECT field1, field2 FROM table"

With rst
.CursorLocation = adUseClient
.Open SQL, cn, adOpenStatic, adLockBatchOptimistic
Set DataGrid1.DataSource = rst
End With

With DataGrid1
.Columns(0).Width = 300
.Columns(1).Width = 3000
End With
 
Never mind. I was closing my connection immediately after and that was losing my data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top