Need help resolving a previous post

G

Guest

I am using a .mdb database directly saved in my Frontpage web. Maybe it
would be best if I describe what I'm trying to accomplish. The page would
have the alphabet across the top. When a user clicked on the letter the
query would run based on the letter clicked. Instead of using 26 different
queries I want to only use one that covers all 26 letters. The fields are
only Label, Name, and Picture in tabel Label. I can either draw from the
query in the database or FrontPage allows me to enter the query directly into
FrontPage. I do understand that the % character replaces the * when using
FrontPage. I'm just not sure how to create the query that will achieve the
result I'm looking for. I don't have much SQL knowledge and I have close to
ZERO VB knowledge.

In the FrontPage discussion group I asked a question about a query and I
received the following response:

select * from table where fieldname like '::letter::%'
if you're coding this you can do
<%
sql="select * from table where fieldname like '" &
request.querystring("letter") & "%'"
' execute your query
%>

I started to attempt to do this query and here is as far as I got

SELECT Labels.Label, Labels.Name, Labels.Picture
FROM Labels
WHERE ((Labels.Name) Like
 
B

Brendan Reynolds

I can't quite figure out, Sam, whether you're building a SQL statement in an
ASP page, or a saved query in Access? If the former, the example you were
given in the FrontPage newsgroup looks correct to me (though my ASP is
admittedly more than a little rusty). If the latter, then you'd have to make
it a parameter query so you could pass the parameter from the ASP page.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
B

Brendan Reynolds

The SQL for the query would look something like this (I've used the
Categories table from Northwind for testing, replace the table and field
names with your own) ...

PARAMETERS [Letter] Text ( 1 );
SELECT Categories.CategoryName
FROM Categories
WHERE (((Categories.CategoryName) Like [Letter] & "*"));

I can't advise on how to call this query from the ASP page, though, like I
said my ASP is decidedly rusty (not that I ever was any kind of expert on
ASP to begin with! :)

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top