Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-17-2012, 06:00 AM   PM User | #1
harivino
New to the CF scene

 
Join Date: Oct 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
harivino is an unknown quantity at this point
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

Code:
<html>
<head>
<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"; 
 
	ConnectObj.Open(myConnect); 
	RS.Open(sql, ConnectObj, adOpenForwardOnly,adLockReadOnly,adCmdText); 
 
	var recordCount = RS.Fields.Count; 
	alert ("recordCount: " + recordCount);

}          


</script>



</head>

<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>
<br>
<br><br>
<center><img src="ca.png" width="300" height="300" border="5px" width="700px" height="500px"> </center><br>
<br><b><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>
BALANCE:
<input type="number" name="inputbox2" maxlength=10" value="">
<br><br><br><br>



<input type="button" value="submit" onClick="simple(this.form)">
<input type="reset" value="clear all">


</div>
</form>
</body>
</html>
harivino is offline   Reply With Quote
Old 10-17-2012, 06:45 AM   PM User | #2
Dormilich
Senior Coder

 
Dormilich's Avatar
 
Join Date: Jan 2010
Location: Behind the Wall
Posts: 2,882
Thanks: 9
Thanked 291 Times in 287 Posts
Dormilich is on a distinguished road
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.
__________________
please post your code wrapped in [CODE] [/CODE] tags
Dormilich is offline   Reply With Quote
Reply

Bookmarks

Tags
connectivity, database, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:38 PM.


Advertisement
Log in to turn off these ads.