Results 1 to 6 of 6

Thread: Javascript and database

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303

    Javascript and database

    Can someone please help me or show me a sample of
    javascript that will connect to a database. Perhaps
    using ODBC would be a plus.

    Thanks in advance for the help.

    Jay

  2. #2
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    Are you talking client-side or server-side JavaScript?

    If you're talking client side, man, that would be a neat trick. I don't think it's possible, however.

    It is possible for a Java Applet to make a JDBC connection back to the server. I think that's the closest thing to what might be attempting.

    cudabean

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303

    I know not what I asked!

    Perhaps server-side. What I want to do is write a
    little javascript that will allow the user to do a simple
    query.

    Thanks for the reply.

  4. #4
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    You might need to take a step back and give a little more details on what you are trying to do. Although I believe it's possible to use JavaScript on the server side to do what you want, you rarely ever hear of people doing it (at least I don't).

    A more mainstream solution would be to use ASP, JSP/Java Servlet, PHP or Perl CGI. In any of Any of these server side languages it's fairly easy for you to make a connection to an ODBC database.

    Generally speaking, nobody does client side ODBC because it's insecure. If a client can access the database, a hacker could possibly get in there and change it or corrupt it.

    So, go with server side ODBC right?
    The problem you will face, however, is server side ODBC access will require that you have access to a server that both has an ODBC database and is willing to let you create a database there, plus it must offer one of the above mentioned server side languages. The basic going rate for such a service is about $US 100 per month.

    Don't be discouraged though. You can set up your desktop or laptop so that it's an internet server whenever you are connected to the net. You can load on the following free software:
    Web server
    PHP, ASP, JSP or Perl CGI
    SQL database with ODBC (Check out free Borland InterBase)

    Once you get your local server up and running and tested, you can then later decide if you want to spend the money to house it on the internet permanently.

    HTH

    cudabean

  5. #5
    scoutt
    Guest
    last time I checked Javascript is only client side. doing a query on a server database will have to be with server-side languages like asp or php or perl.

  6. #6
    Hyperactive Member thinktank2's Avatar
    Join Date
    Nov 2001
    Location
    Arctic
    Posts
    272
    Javascript is a scripting language !

    You can use it for both server side programming as well as client side programming.

    Server-side JavaScript is available in Netscape Enterprise Server and Netscape's e-commerce products, enables back-end access to databases, file systems, and servers.

    You can also use Javascript in ASP. ASP is not a vbscript thing !!!
    Infact it's like a API. You can use vbscript,Jscript(Javascript), Perlscript,python etc...with ASP.

    Using JScript(Microsoft's Version of Javascript) you can access ADO just like you do in vbscript.

    Examples of using ADO from Jscript is given here:
    http://msdn.microsoft.com/library/de...sinjscript.asp

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