Results 1 to 7 of 7

Thread: Calling a database using JS

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question Calling a database using JS

    I wish to make a database call with a JS-function. I have tried to use the code coming from SCOUT, but I had no succes, what am I doing wrong?
    Code:
    function LngText(TextID,Language) {
    Language = 1;
    TextID = 1;
    'if you have language columns
    objRS= "SELECT "& Language &" FROM Generelt WHERE ID="&TextID&";",dpd_sprog.mdb
    'if you have langauge tables
    objRS= "SELECT text  FROM "&Language&" WHERE ID="&TextID&";",dpd_sprog.mdb
    
    LngText=objRS
    document.navform.text21.value = LngText
    end function

  2. #2
    scoutt
    Guest
    huh I don't even know JS let alone ASP. didn't get it from me...

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    SOrry, it was NETSCOUT2!

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    But I must ask you, if you are familiar using ASP, can I solve my problem using a function in ASP? I have only used functions written in JS

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    I don't think you can use JS to access a database. You'll have to use a language ASP, or CGI or PHP.... to answer your question, yes, asp would help you.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    OK, thanks! Can I use the function above as a JS function? I think about the onClick-events and so on. The next question is, will the function above work in ASP?

  7. #7
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    You can access a database with server-side JScript, but again thats related to ASP so you might as well us that
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width