PDA

Click to See Complete Forum and Search --> : Dynamic Adodc RecordSource?


Skrmetti
Jul 19th, 1999, 09:52 PM
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."

preeti
Jul 19th, 1999, 10:15 PM
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

Skrmetti
Jul 19th, 1999, 10:26 PM
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."

preeti
Jul 20th, 1999, 11:54 AM
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