Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1

    Unanswered: Access and alter an ADO views commandtext?

    Howdy folks, hope everyone had a great weekend!!

    I am running into a bit of a block here. I am in a situation which requires me to build a dynamic where clause prior to executing a view. I am having difficulty accessing the commandtext, or recordset property of an ADO view. What collection should I be looking at?

    Here's to hoping someone knows!!

    **For reference, my environment is in my sig.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Code:
        Dim cmd As ADODB.Command
        Dim cat As New ADOX.Catalog
        Dim strSQL as String
        cat.ActiveConnection = CurrentProject.Connection
        Dim qry As View
        Set qry = cat.Views("YourQueryNameGoesHere")
        Set cmd = qry.Command
        strSQL = cmd.CommandText
        cmd.CommandText = strSQL & WhateverYouNeedToAdd
        Set qry.Command = cmd
        Set qry = Nothing
        Set cmd = Nothing
        Set cat = Nothing
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    n/m got it.

    Had some reference shenanigans.
    Last edited by Teddy; 06-02-04 at 12:12.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Bad news, sql server doesn't support the views collection from ADOX.

    Any other ideas?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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