Results 1 to 4 of 4

Thread: Dynamic Adodc RecordSource?

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    33

    Post

    Is it possible to change the record source of an Adodc control based on user input? I am trying to use the search criteria input by the user to create an SQL string that will serve as the RecordSource for an Adodc control, and I have had absolutely no success. I am obviously new at this, and am completely lost. The reference books I've been using, while generally helpful, have been almost useless as far as this sort of thing goes.

    Alternatively, if there is an easier way to filter a database based on a query and display the appropriate records, I would be just as happy to learn that. SQL seems very straightforward, but I am having a tough time integrating it into my VB work.

    Thanks,
    Jonathan

    ------------------
    "Black?"
    "For over thirty years."

  2. #2
    Lively Member
    Join Date
    Jan 1999
    Posts
    82

    Post

    Hi,

    It is possible, just remember to refresh the adodc control after:

    Adodc1.RecordSource = "SELECT * FROM tablname WHERE (" & userinputcriteria & ")"
    Adodc1.Refresh

    Refresh will requery the control.

    HTH,

    Preeti

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    33

    Post

    Thanks Preeti, you've been a lot of help. I have one other question, for you or anyone else who cares to answer: what is the best reference book for database development on VB6? I am just doing this as a summer job, so if the best book is ridiculously expensive (over $60 or so) just tell me what the best cheap book is. In my office all we have are references for VB4 and below, and with Adodc and a few other important subjects the old books just don't cut it.

    Thanks,
    Jonathan

    ------------------
    "Black?"
    "For over thirty years."

  4. #4
    Lively Member
    Join Date
    Jan 1999
    Posts
    82

    Post

    Hi,

    Most books are ridiculously expensive

    Try searching on msdn.microsoft.com.

    For simple easy stuff they have a lot of info. For everything else, there are the forums!! Or just good ole trial and error!

    HTH,

    Preeti

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