Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


DataGrid just empty!

DataGrid just empty!

DataGrid just empty!

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.

RE: DataGrid just empty!

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"
Print Adodc1.Recordset(0)     'can get text here
Set DataGrid1.DataSource = Adodc1   'datagrid1 just empty

End Sub

RE: DataGrid just empty!

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&


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close