|
| |
|
|
webcats
Posts: 5 Joined: 8/23/2003 Status: offline
|
Database using Access query - passing parameter - 8/23/2003 22:22:56
I'm using .asp pages to query an Access database using a query I created in Access (specified in the DRW). What I'd like to do is specify a parameter to limit the query's results. The query field that I'm using, AreaID should = the specific Website (there are about 12). I tried creating the database results, then changing to HTML view and adding "WHERE AreaID=3" to the "s-sql=" and "fp_sQry=" parts, but I get an error: Too few parameters. Expected 1. Number: -2147217904 I'd prefer not to use a Custom Query. Anyone have any ideas? Thanks.
|
|
|
|
Spooky
Posts: 26657 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Database using Access query - passing parameter - 8/24/2003 1:40:55
Can you post your fp_sQry string (from the red code)
_____________________________
If you arent part of the solution, then there is good money to be made prolonging the problem §þ k¥
|
|
|
|
webcats
Posts: 5 Joined: 8/23/2003 Status: offline
|
RE: Database using Access query - passing parameter - 8/24/2003 16:04:51
Hi, here it is: fp_sQry="SELECT * FROM qryPets WHERE AreaID=3" Thanks.
|
|
|
|
Spooky
Posts: 26657 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Database using Access query - passing parameter - 8/24/2003 16:47:03
Ahh, ok - you are using an Access query. Its not something I have attempted to do via the DRW and believe its not possible (I may try it soon though!) Typically youll do it via custom asp. Reference this thread for example : http://www.frontpagewebmaster.com/m_77788/tm.htm
_____________________________
If you arent part of the solution, then there is good money to be made prolonging the problem §þ k¥
|
|
|
|
webcats
Posts: 5 Joined: 8/23/2003 Status: offline
|
RE: Database using Access query - passing parameter - 8/24/2003 17:02:33
Yeah, I think you're right about it not being possible. When I modify the "fp_sQry="SELECT * FROM qryPets" line to "fp_sQry="SELECT * FROM qryPets WHERE AreaID=3" then save... it goes back to the plain Select line. (I didn't notice that before...) Now I gotta get out my ASP Databases book and start reading! Thanks anyway.
|
|
|
|
BeTheBall
Posts: 6465 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Database using Access query - passing parameter - 8/24/2003 18:23:09
quote:
When I modify the "fp_sQry="SELECT * FROM qryPets" line to "fp_sQry="SELECT * FROM qryPets WHERE AreaID=3" then save... it goes back to the plain Select line. (I didn't notice that before...) The code is re-writing itself because of the extra code that Frontpage puts in (the gray code). Find the same SQL in the gray code and make your change there instead of in the red. It should work. You also may want to learn how to get rid of the gray code. It makes life a lot easier. Read about the Spooky Diet.
< Message edited by betheball -- 8/24/2003 6:28:37 PM >
|
|
|
|
webcats
Posts: 5 Joined: 8/23/2003 Status: offline
|
RE: Database using Access query - passing parameter - 8/24/2003 18:43:26
Yeeeaaaahhh! It works! I don't understand why though... I was actually modifying both the Gray and the Red code before, then tried just the Red. I guess I should have taken it all the way and just modified the Gray only. Oh well, as long as it works. Thanks!
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Database using Access query - passing parameter - 8/25/2003 16:17:44
quote:
Ahh, ok - you are using an Access query. Its not something I have attempted to do via the DRW and believe its not possible That's funny, I think I do that all the time.....call the Access query instead of the table itself. If we're talking about the same thing, it definitely is possible...
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|

New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|