Read full document

Engineering Paper

By | Feb. 2013
Page 1 of 3
<html>
<head>
<body>
<form name="dbSource" action="">
<h1><center><u>Becky Lok and Andrew Maclaine HTML/JavaScript Database Client</u></center></h1> <p>
<p>
<p>
MySQL
<p>
<p>
Host:<br>
<input type= "text" name= "host" size="30" />
  
DSN:
<input type= "text" name= "dsn" size="30" />
  
Local
Access:
<input type= "text" name= "localaccess" size="30" />
<p>
User:<br>
<input type= "text" name= "user" size="30" />
<p>
Password:<br>
<input type= "text" name= "password" size="30" />
<p>
Database:<br>
<input type= "text" name= "database" size="30" /> <br><br><br> Query:
<p>
<input type="button" value="Submit" onclick="send();" /><br> <textarea name="inputQuery" rows="30" cols="100"/>
</textarea>
<p>
<p>
<p>
<p>
Results:
<p>
<input type="button" value="Clear Results" onclick="erase();" /> <br> <textarea name="results" rows="30" cols="100" readonly=true/> </textarea>
</form>
</body>
<script language="JavaScript" type="text/javascript">
function erase()
{
dbSource.results.value="";
}
function send ()
{
var db;
var rs;
var strSQL;
db=new ActiveXObject("ADODB.Connection")
if(dbSource.localaccess.value!="")
{
str= "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= "
str+= dbSource.localaccess.value;
db.Open(str);
}
else if(dbSource.dsn.value!="")
{
str="DSN=";
str+=dbSource.dsn.value;
db.Open(str)
}
else if(dbSource.host.value!="")
{
str="Driver={MySQL ODBC 5.1 Driver}; Server="
str+=dbSource.host.value;
str+=";Port=3306;Database=";
str+= dbSource.database.value;
str+=";User="
str+=dbSource.user.value;
str+=";Password="
str+=dbSource.password.value;
str+=";Option=3;"
db.Open(str);
}...
Hide

Rate this document

What do you think about the quality of this document?

Share this document

Let your classmates know about this document and more at Studymode.com