Link to home
Start Free TrialLog in
Avatar of njacques
njacques

asked on

Single Database, multiple queries!

Hello!

I am brand new to Visual Web Developper 2005.

However, i have been able to create nice stuff.

Here is what i am unable to do, or let's say almost.

i have a databound control (tested with Textbox and gridview, both same behaviour)

linked to an Acessdatasource control called "Library1"

The Library1 control access the Something.mdb

I have created a query that goes something like this

SELECT * FROM [Info] WHERE ([Path] LIKE '%' + ? + '%') ORDER BY [Cleanname] DESC

What i want to do is manage the ? value to put anything (by code) so that the databound control gets refresh to displays the new data.

I am able to specify what the default value for ? is, and that works.

I have also created some additional queries, that are in fact the same, but with different default values ?.

Is there a way to switch from a value, or from a query to an other, or create multiple connection to the something.mdb file with there own query? so that depending of a value in a dropdown, the user gets a refreshed database with correct being sown.

Hope you can help!

NJ
 
ASKER CERTIFIED SOLUTION
Avatar of kGenius
kGenius
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of njacques
njacques

ASKER

Thanks! Work perfectly ; Consider that Comment to be Accepted...

I now better understand the "Control" parameter source usage.

Just a little question.

I left the query as is:

SELECT * FROM [Info] WHERE ([Path] LIKE '%' + ? + '%') ORDER BY [Cleanname] DESC

why have you recommended to use:

SELECT * FROM [Info] WHERE ([Path] LIKE '%' + @PathPart + '%') ORDER BY [Cleanname] DESC

Where is the @PathPart  defined and what is its need versus "?" ?

Thanks

NJ
Well the ? is not accepted in the SQL statement when using SQL 2000. There must be a parameter @blabla provided.
For Access maybe the ? does work (had no idea, I do not use it...)
So if it does you could use it your way.
Can you try with the parameter and let me know if that works with Access? (just for knowing)

kGenius
I does work both ways! thanks!