-
Howdy:
I have an ADO connection to an ACCESS97 db using a data control (the connection is fine)
I am trying to attach the datasource property of a MSFlexGrid to the data control.
I get the error:
"No compatable data source was found for this control. Please add an intrinsic Data Control. "
What am I missing? A Reference, a different Data Control?
Help!
Thanx
-
<?>
a different Data Control seems logical unless you are
coding the datacontrol and setting and resetting it's
source and fields in seperate parts of your code.
-
Make sure your using the ADO data control and not the DAO data control.
The control available in the default toolbox window for a new project is the DAO control.
BTW- If you are doing any serious programming, learn ADO without the data control. The data control is not something you will find in any professionally developed program. Binding controls to data with a datacontrol is not very flexable and ADO's object model is very easy to learn.
-
I am using ADO Controls. I know how to use ADO throgh code.
This also errors out:
Set db = New Connection
db.CursorLocation = adUseClient
dbname = "Provider=Microsoft.Jet.OLEDB.4.0;
DataSource=C:\VB98\Nwind.mdb;Persist Security Info=False"
db.Open dbname
Set adoprimaryrs = New Recordset
adoprimaryrs.Open "Select * from Customers", db, adOpenStatic, adLockOptimistic
Set grid.DataSource = adoprimaryrs
The grid is a flexgrid.
Help!
-
You have to use MSHFlexGrid instead.
Code:
Private Sub Command1_Click()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Program Files\VB98\NWIND.MDB"
rs.Open "Select * From Customers", cn, adOpenStatic
Set MSHFlexGrid1.DataSource = rs
End Sub