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!

Cannot set anything in DataGrid?

Status
Not open for further replies.

welldefined

Programmer
Mar 9, 2006
62
GB
Very strange!!
I used DataGrid to display .mdb by connection and recordset by ADO. It works fine. I then set the layout propty and run again, but nothing can by displaied this time! I change back the setting, no good. Why?
 
WellDefined:

Show the code and someone will probably be able to help.



Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Perhaps I didn't expain clearly, let me try again:

I used VB+DataGrid to display .mdb, It works fine. Then, in design mode, I set the layout Alignment propty from 1 to 2 and run again, but nothing can be displaed this time! I change back the setting to 1, still no good.

Following is my code, I don't think anything to do with this, but:

Dim oConnection As New adodb.Connection, oRecordset As New adodb.Recordset
Dim dFile As String

dFile = App.Path & "/dFile.mdb"
oConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dFile
oRecordset.CursorLocation = adUseClient
oRecordset.Open "Select * from table1", oConnection, 3
Set DataGrid1.DataSource = oRecordset
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top