Hi I have this query. - lngCategoryID=CLng(Request("CategoryID"))
-
If lngCategoryID <> "" And lngCategoryID <> 0 Then
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
SQLQuery="Select postcardid,DefaultHeadline,CardDescription,gallery,DefaultMessage,extrathree,Author,Artist,tip,NewImageOne,"
-
SQLQuery= SQLQuery & "NewImageTwo,titleimagesix,largeimageseven,ThumbnailURL,"
-
SQLQuery= SQLQuery & "SUM(tblLinkTrackerLog.hit_count) AS totalhits From tblGreetingPostCards LEFT OUTER JOIN "
-
SQLQuery= SQLQuery & "tblLinkTrackerLog ON "
-
SQLQuery= SQLQuery & "tblGreetingPostCards.postcardid = tblLinkTrackerLog.link_id "
-
SQLQuery= SQLQuery & "Where CategoryID=" & Clng(lngCategoryID) & " "
-
SQLQuery= SQLQuery & "GROUP BY postcardid,DefaultHeadline,CardDescription,gallery,DefaultMessage,extrathree,Author,Artist,tip,NewImageOne,"
-
SQLQuery= SQLQuery & "NewImageTwo,titleimagesix,largeimageseven,ThumbnailURL "
-
SQLQuery= SQLQuery & "ORDER BY SUM(tblLinkTrackerLog.hit_count) "
-
rsCard.Open SQLQuery, connPostCardSoft
-
rsCard.PageSize = 100
-
intPageCount = rsCard.PageCount
-
-
If rsCard.EOF=True Then
-
response.redirect "./"
-
Response.End
-
End If
-
End If
It works fine. Trouble is I want for search engine optimisation it not to throw up an error on the page when the page is visited without the query in the address, for example
www.mysite.com/directory.asp
www.mysite.com/directory.asp?categoryid=55
at the moment i get this error - icrosoft VBScript runtime error '800a01a8'
-
Object required: ''
-
-
/directorycontentalt.asp, line 156
when the page is served just www.mysite.com/directory.asp
It has been suggested to me that I should write something along these lines.
select case categoryID
case 1 : showthem page1
case 2 : showthem page2
case 3 : showthem page3
case 4 : showthem page4
case else : showthem page0
end select
but I dont know how or where to write it. Any pointers would be great.
Thanks
Richard
3 2469
When lngCategoryID does not have a value, you should just have some generic html page with your keywords so the search bots will be happy.
If you are getting an error message, it means that your filtering: -
If lngCategoryID <> "" And lngCategoryID <> 0 Then
-
is not working. Theoretically, it should just ignore your whole If statement and do nothing.
Personally, I use If Len(lngCategoryID)> 0 to test for empty variables. This works on both numerics and strings.
Try that and see if it works for you.
Thanks Krandor,
That worked great
Richard
Personally, I use If Len(lngCategoryID)> 0 to test for empty variables. This works on both numerics and strings.
Thanks for your suggestion. I tend to use
but I haven't been fully satisfied with it, yours looks like a better idea.
Jared
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Newbie |
last post by:
Dear friends,
I am having a hard time understanding how to use a SELECT CASE in ASP. I
have used it in VB but never in ASP scripting.
Scenerio:
I have 2 textboxes on a form that I have to...
|
by: grunar |
last post by:
After some thought on what I need in a Python ORM (multiple primary
keys, complex joins, case statements etc.), and after having built
these libraries for other un-named languages, I decided to...
|
by: Tcs |
last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't
loaded it yet. I'm still using MS Access. And no, I don't believe this is an
Access question. (But who knows? I...
|
by: deko |
last post by:
When I loop through this function, it works fine until it hits End
Function - then it jumps to End Select. Very strange... This behavior
occurs when Case = 255. Any ideas why this is happening? ...
|
by: Lauren Quantrell |
last post by:
Is there any speed/resource advantage/disadvantage in using
Select Case x
Case 1
Case 2
etc. many more cases...
End Select
VS.
|
by: mark.irwin |
last post by:
Hello all,
Have an issue where a redirect pushes data to a page with a select case
which then redirects to another page. Problem is the redirect isnt
working in 1 case. Code below:
strURL =...
|
by: |
last post by:
Hello,
This is gonna sound real daft, but how do I test a Select Case statement for
variants of a theme?
Here's a snippet of my code...
Select Case sUsr
Case "Guest", "TsInternetUser",...
|
by: scole954387 |
last post by:
Hi,
I have a problem. I have written a SQL statement that has a nested
select case statement on the 'where' clause to condition the results.
...
|
by: microsoft.public.dotnet.languages.vb |
last post by:
Hi All,
I wanted to know whether this is possible to use multiple variables to
use in the select case statement such as follows:
select case dWarrExpDateMonth, dRetailDateMonth
case...
|
by: beacon |
last post by:
Hello to everybody,
I have a section on a form that has 10 questions, numbered 1-10, with 3 option buttons per question. Each of the option buttons have the same response (Yes, No, Don't know),...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |