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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid just empty!

Status
Not open for further replies.

jslmvl

Vendor
Jan 26, 2008
268
GB
Hi, following VB6+Access code was working fine, but today it not works: DataGrid just empty!

Private Sub Command1_Click()
Dim oConnection As New ADODB.Connection, oRecordset As New ADODB.Recordset

oConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "/dFile.mdb"
oRecordset.CursorLocation = adUseClient
oRecordset.Open "Select * from table1", oConnection
Print oRecordset.Fields(1) 'can get text here
Set DataGrid1.DataSource = oRecordset 'datagrid1 just empty

End Sub

Thanks a lot for your suggestions.
 
Hi, I have just tried to use ADODC, datagrid was also empty:

Private Sub Command2_Click()

Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\dFile.mdb"
Adodc1.RecordSource = "select * from table1"
Adodc1.Refresh
Print Adodc1.Recordset(0) 'can get text here
Set DataGrid1.DataSource = Adodc1 'datagrid1 just empty

End Sub
 
If the grid is showing as many empty rows as records in the table, then using the first example, check the color of the grid's record selector. It may be White. Click on the grid and then check the ForeColor of the Grid in the properties window and set it to &H00000000&. Set it's BackColor to &H00FFFFFF&


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top