|
Prev: ASP Page Generates: The requested resource is in use error.
Next: Kidd Blue legal mp3 music downloads
From: .nLL on 15 Apr 2008 13:39 thank you very much "Bob Milutinovic" <cognicom(a)gmail.com> wrote in message news:e1P7qGrnIHA.4536(a)TK2MSFTNGP06.phx.gbl... > Oops, force o' habit got in the way here; amended version follows at > bottom. > > "Bob Milutinovic" <cognicom(a)gmail.com> wrote in message > news:O5ifHDrnIHA.1212(a)TK2MSFTNGP05.phx.gbl... >> ".nLL" <noone(a)here.com> wrote in message >> news:c3QMj.149467$833.115837(a)newsfe17.ams2... >>> got a multi languagel site. >>> my aproach was to create >>> >>> CREATE TABLE [dbo].[languages]( >>> [lang] [nvarchar](3) NOT NULL, >>> [lang1] [nvarchar](200) NULL, >>> [lang2] [nvarchar](200) NULL, >>> [lang3] [nvarchar](200) NULL, >>> [lang4] [nvarchar](200) NULL, >>> ........................ >>> <SNIP> >>> ........................ >>> [lang310] [nvarchar](200) NULL >>> ) ON [PRIMARY] >>> >> >> <snip> >> >> How does one express profuse head-shaking using only 7-bit ASCII? >> Aaaaaargh! >> >> Try applying some logic to the problem, and you'll find a far more >> elegant 'n' functional solution, infinitely easier to manage, and >> massively more scalable. >> > > CREATE TABLE Languages ( > ID int IDENTITY(1,1) NOT NULL, > PhraseID int NOT NULL, > Lang nvarchar(5) NOT NULL, > Phrase nvarchar(200) NOT NULL) > > ..... > > FUNCTION getLang(iPhrase, sLang) > '--- assumes cDB is an already-established database connection > '--- input value sanitisation should be implemented! > sFunctionResult = "" > SET rsResult = cDB.Execute("SELECT Phrase FROM Languages WHERE > PhraseID=" & iPhrase & " AND Lang='" & sLang & "'") > IF NOT rsResult.EOF THEN > sFunctionResult = rsResult("Phrase") > END IF > SET rsResult = NOTHING > getLang = sFunctionResult > END FUNCTION > >
First
|
Prev
|
Pages: 1 2 Prev: ASP Page Generates: The requested resource is in use error. Next: Kidd Blue legal mp3 music downloads |