I have an MSHFlexGrid Control on my form. The user types in a page number. on the return keypress, a connection to the database is made and a select statement is executed. the results from the select statement are to appear in the MSHFlexGrid control. (MSHFlexGrid1.DataSource = RS)
The first row of the grid is getting all of the field names from the database table. However, the rows of data beneath are not getting populated, and I'm getting a run time error 30023... Unable to access data. DatSource settings may be incorrect or the DataSource functionality may be limited. See help for more information.
The help for this topic also errors out, figures.
Any suggestions? Here's how I'm trying to do it....
------------
Private Sub txtC2001ViewPage_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
txtC2001ViewPage.Text = ""
End If
If KeyAscii = 13 Then
KeyAscii = 0
Dim PageText As String
PageText = txtC2001ViewPage.Text
Set CN = New Connection
CN.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\\NTS02\WEISSMANS\DATABASE\xxx.mdb;xxx;xxx;'"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Set RS = New Recordset
RS.Open "select * from catalog_c2001 WHERE PAGE = '" & PageText & "'", CN, adOpenForwardOnly, adLockReadOnly
Set MSHFlexGrid1.DataSource = RS
.....................
The first row of the grid is getting all of the field names from the database table. However, the rows of data beneath are not getting populated, and I'm getting a run time error 30023... Unable to access data. DatSource settings may be incorrect or the DataSource functionality may be limited. See help for more information.
The help for this topic also errors out, figures.
Any suggestions? Here's how I'm trying to do it....
------------
Private Sub txtC2001ViewPage_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
txtC2001ViewPage.Text = ""
End If
If KeyAscii = 13 Then
KeyAscii = 0
Dim PageText As String
PageText = txtC2001ViewPage.Text
Set CN = New Connection
CN.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\\NTS02\WEISSMANS\DATABASE\xxx.mdb;xxx;xxx;'"
Set RS = New Recordset
RS.Open "select * from catalog_c2001 WHERE PAGE = '" & PageText & "'", CN, adOpenForwardOnly, adLockReadOnly
Set MSHFlexGrid1.DataSource = RS
.....................