Results 1 to 5 of 5

Thread: Hopefully Easy

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    148
    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


  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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.

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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.

    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    148
    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!

  5. #5
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width