View Single Post
Old 06-30-2009, 07:28 AM   #1 (permalink)
sblat
Recruit
 
Join Date: Jun 2009
Posts: 3
sblat is on a distinguished road
Language Site Using SQL Database and ASP

I have created a database containing the content for a website that has four languages.

When I change the variable from text to a variable eg from:

SELECT * FROM cjr_con WHERE [Page URL] = 'news.asp' AND [Language] = 'en'

to SELECT * FROM cjr_con WHERE [Page URL] = 'news.asp' AND [Language] = cjr

I get an error stating that cjr does not have a default value, even if I dim the variable a set its value

Dim cjr
cjr = "en"

Ideally what I am trying the achieve is loading the same pages into the asp page but with different languages filtered via [Language] which would be stored into the session variable cjr_lang.

I want to be able to check on every page that there is already a value for the variable cjr_lang and if not make it the default english "en":

Dim cjr
If Session("cjr_lang") ="" then cjr = "en"
else cjr = Session("cjr_lang")
End If
I've placed within an include file that appears on every page

The variable would be loaded within every page via a flag motive that would set the variable cjr_lang to the correct name eg "en", "es", "fr" and then reload the page.

Is this a viable method!

Any suggestions would be greatfuly received
sblat is offline   Reply With Quote