473,246 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,246 software developers and data experts.

Changing Session.LCID in a hyperlink

Rob
Hi all,

Is it possible to change the Session.LCID in a hyperlink?
My problem is I'm calling a Date from a database to use as a querystring in
the hyperlink but I also need to display the date as output from the
hyperlink.
I need to have to querystring in Session.LCID = 1033 and the display date in
Session.LCID = 2057.

Coding :-

Session.LCID = 1033
<a href=""applybankholiday.asp?date=" & rshelpdesk("date") & """>" &
rshelpdesk("date") & "</a></font></td>")

Whereever I put Session.LCID = 2057 I either get errors saying its in the
wrong place or It displays false. Tried the following that gives the false.

Session.LCID = 1033
<a href=""applybankholiday.asp?date=" & rshelpdesk("date") & """>" &
Session.LCID = 2057 & rshelpdesk("date") & "</a></font></td>")
Any ideas?
Many thanks in advance,
Robert
Jul 19 '05 #1
8 4824
Why are you using Session.LCID at all? How about formatting your date in a
standard, non-ambiguous format???

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Rob" <ro*@rob.com> wrote in message
news:c7**********@sparta.btinternet.com...
Hi all,

Is it possible to change the Session.LCID in a hyperlink?
My problem is I'm calling a Date from a database to use as a querystring in the hyperlink but I also need to display the date as output from the
hyperlink.
I need to have to querystring in Session.LCID = 1033 and the display date in Session.LCID = 2057.

Coding :-

Session.LCID = 1033
<a href=""applybankholiday.asp?date=" & rshelpdesk("date") & """>" &
rshelpdesk("date") & "</a></font></td>")

Whereever I put Session.LCID = 2057 I either get errors saying its in the
wrong place or It displays false. Tried the following that gives the false.
Session.LCID = 1033
<a href=""applybankholiday.asp?date=" & rshelpdesk("date") & """>" &
Session.LCID = 2057 & rshelpdesk("date") & "</a></font></td>")
Any ideas?
Many thanks in advance,
Robert

Jul 19 '05 #2
Rob
Could point, although not sure how to. The date is in uk format i.e.
dd/mm/yy in an access database. When I try and do a date range query in asp
it only works if I use the american format mm/dd/yy.
If you know of a way round this or how to do the formatting then I'd be
grateful.

Many thanks,
Robert
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:eu**************@tk2msftngp13.phx.gbl...
Why are you using Session.LCID at all? How about formatting your date in a standard, non-ambiguous format???

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Rob" <ro*@rob.com> wrote in message
news:c7**********@sparta.btinternet.com...
Hi all,

Is it possible to change the Session.LCID in a hyperlink?
My problem is I'm calling a Date from a database to use as a querystring in
the hyperlink but I also need to display the date as output from the
hyperlink.
I need to have to querystring in Session.LCID = 1033 and the display date in
Session.LCID = 2057.

Coding :-

Session.LCID = 1033
<a href=""applybankholiday.asp?date=" & rshelpdesk("date") & """>" &
rshelpdesk("date") & "</a></font></td>")

Whereever I put Session.LCID = 2057 I either get errors saying its in

the wrong place or It displays false. Tried the following that gives the

false.

Session.LCID = 1033
<a href=""applybankholiday.asp?date=" & rshelpdesk("date") & """>" &
Session.LCID = 2057 & rshelpdesk("date") & "</a></font></td>")
Any ideas?
Many thanks in advance,
Robert


Jul 19 '05 #3
> Could point, although not sure how to. The date is in uk format i.e.
dd/mm/yy in an access database.
NO! The date is not in any format inside the database. It is merely being
presented to you as such. To pass a standard, non-ambiguous date to Access,
which will never be misinterpreted, use #YYYY-MM-DD#.

http://www.aspfaq.com/2313
When I try and do a date range query in asp
it only works if I use the american format mm/dd/yy.


Again, if you are trying to find rows that are >= 20040101 and <= 20040131
try

WHERE dateColumn >= #2004-01-01# AND dateColumn < #2004-02-01#

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #4

"Rob" <ro*@rob.com> wrote in message
news:c7**********@sparta.btinternet.com...
Could point, although not sure how to. The date is in uk format i.e.
dd/mm/yy in an access database. When I try and do a date range query in asp it only works if I use the american format mm/dd/yy.
Do you mean when using "#" to delimit dates?

I think if you use #01/11/2004# syntax in MS SQL, this will always mean

11th day of January

irrespective of any locale settings.

<a href=""applybankholiday.asp?date=" & rshelpdesk("date") & """>" &
rshelpdesk("date") & "</a></font></td>")


How about...

dim d

d = rshelpdesk("date")

"<a href=""applybankholiday.asp?date=" & month(d) & "/" & day(d) & "/" &
year(d) & """>" &
d & "</a></font></td>"

However, I suspect nothing is foolproof for non-US date formats.
--
roger
Jul 19 '05 #5
> I think if you use #01/11/2004# syntax in MS SQL, this will always mean

11th day of January

irrespective of any locale settings.


No, this is incorrect on at least two counts.

(1) SQL Server will barf on # as delimiters. Run this in Query Analyzer:

DECLARE @dt SMALLDATETIME
SET @dt = #01/11/2004#

You will get this:

Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '#'.

(2) SQL Server will certainly *NOT* always interpret 01/11/2004 as January
11th. Even if you have a US locale and set up SQL Server as US English,
feel free to run this simple repro in Query Analyzer:

SET LANGUAGE FRENCH
GO

SELECT DATENAME(MONTH, '01/11/2004')

SET LANGUAGE ENGLISH
GO

Let us know if you get janvier or novembre!

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #6
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:uT**************@TK2MSFTNGP12.phx.gbl...
I think if you use #01/11/2004# syntax in MS SQL, this will always mean

11th day of January

irrespective of any locale settings.


No, this is incorrect on at least two counts.

(1) SQL Server will barf on # as delimiters. Run this in Query Analyzer:


True... but we were discussing MSAccess.

In that context, "MS SQL" was meant to mean the MS version of SQL included
with Access.
--
roger
Jul 19 '05 #7
> True... but we were discussing MSAccess.

In that context, "MS SQL" was meant to mean the MS version of SQL included
with Access.


I think in 99% of all cases, MS SQL will be interpreted as SQL Server...
even if the discussion had previously involved a different platform.

And even with Access, #mm/dd/yyyy# is STILL not a safe format to use. The
only truly safe format to use in Access is #YYYY-MM-DD#
Jul 19 '05 #8
roger wrote:
In that context, "MS SQL" was meant to mean the MS version of SQL
included with Access.


For future reference, that version is called "JetSQL", due to its use with
the Jet database most commonly used with Access (remember: Access is not the
database. Access is a front-end tool for working with several databases,
including Jet and MSDE).

Also, "MS SQL" will always be interpreted as MS SQL Server. The version of
SQL used by MS SQL Server is called Transact-SQL (often shortened to T-SQL)

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Claudio Cezar | last post by:
I live in Brazil and i am trying to set my application to work with american date format. The problem is, even when i set the LCID property at the beginning of my code, it always returns the...
1
by: Shaiboy_UK | last post by:
Hi All, Sorry if this is the wrong newsgroup to post into, on this topic, if so, please point me in the right direction..... Currently working on a ASP for a friend, which requires the date...
2
by: grw | last post by:
Trying to locate the list of valid lcid's on MS's site and googled. Ive toiled long and hard, but alas I cannot locate the information. (previous links moved) Could anyone point me in the...
0
by: David Patow | last post by:
Can anyone explain why neither ASP Session.LCID nor VBScript SetLocale() effect the locale of a VB6-based COM object that is instantiated via Server.CreateObject()? If I set Session.LCID, then...
0
by: Darren | last post by:
I used the following code on a server; <% ReturnDateTime 1033, "English (US)" ReturnDateTime 2057, "English (UK)" ReturnDateTime 3081, "English (Australia)" ReturnDateTime 1031, "German" ...
6
by: J. Baute | last post by:
I'm doing some tests to see if the Session.LCID can be used to easily change a user-dependant locale for number & date/time formatting in ASP. As far as I get the theory this should work, but I'm...
0
by: ubi_comp | last post by:
Hi, I have a windows 2003 server IIS6 machine in development environment. I set Session.Lcid in aspx Page1 and move to aspx Page2 and use Session.Lcid value that I set in the Page1 without...
2
by: Ned Balzer | last post by:
Hi, Apologies if this is a newbie question, I haven't found the answer in any faqs. I have an asp.net 2.0 page that sets session variables and then redirects to another page. For the page...
0
by: Just4U | last post by:
Hello, My config : Windows 2003 x64 (US VERSION) + sp2, IIS 6 All regional settings to French (even for default user) In my ASP pages dates are in the good format (french:dd/mm/yyyy), but...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.