Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Thanked 0 Times in 0 Posts

    database connection using javascript

    i given the full code
    is there any need to be installed for database connectivity from javascript
    how do i check whether it is installed or not
    what is the problem with following code

    <title> MTC NEW ACCOUNT </title>
    <script type="text/javascript">
    function simple(form)
    	var name 	= form.inputbox.value;
    	var id   	= form.inputbox1.value;
    	var balance 	= form.inputbox2.value;
    	alert(id+" "+name+" "+balance);
    	adOpenForwardOnly = 0; 
    	adLockReadOnly = 1; 
    	adCmdText = 1; 
    	var myConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\HARI\\Desktop\\html pro new\\vino\\mtc.mdb";  
    	var ConnectObj = new ActiveXObject("ADODB.Connection"); 
    	var RS = new ActiveXObject("ADODB.Recordset"); 
    	var sql = "INSERT INTO Admin VALUES name, id, balance"; 
    	RS.Open(sql, ConnectObj, adOpenForwardOnly,adLockReadOnly,adCmdText); 
    	var recordCount = RS.Fields.Count; 
    	alert ("recordCount: " + recordCount);
    <body bgcolor="lightblue">
    <form name="myform" action="" method="GET">
    <font face="times new roman" size="10" color="red" <center><marquee>ACCOUNT CREATION...!</marquee></center></font>
    <center><img src="ca.png" width="300" height="300" border="5px" width="700px" height="500px"> </center><br>
    <div align="center">
    NAME:<input type="text"   name="inputbox"     value=""><br><br>
    IDNO:<input type="number" name="inputbox1"    value=""><br><br>
    SELECT VECHILES<br><select><option>CAR</option><option>HUGE VEHICLE</option></select><br><br>
    <input type="number" name="inputbox2" maxlength=10" value="">
    <input type="button" value="submit" onClick="simple(this.form)">
    <input type="reset" value="clear all">

  2. #2
    Master Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Behind the Wall
    Thanked 568 Times in 561 Posts
    whether there is a syntax error in this JScript I cannot tell (MSDN would be the prime source here), but I can tell you that even JScript does not look for variables inside strings (unlike PHP).

    and that it doesn’t work in any other browser than IE should be obvious.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


Tags for this Thread

Posting Permissions

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