ASP Source Code
ASP File: jscript/ado/authors/default.asp
ASP Script
Comments or Client-side Script
HTML and Text
<%@ Language=JavaScript %>
<HTML>
<HEAD>
<TITLE>Database's Operation Sample</TITLE>
<%
path = Server.mappath("default.asp");
pos = path.toLowerCase().indexOf("jscript");
dbpath = path.substring(0,pos) + "database/CloudscapeDB";
drvIdx = Request.QueryString("drvtxt");
DrvArry = new Array(15); // '(17)
DrvArry[0] = "--Please select a driver--";
DrvArry[1] = "sun.jdbc.odbc.JdbcOdbcDriver (Access)";
DrvArry[2] = "sun.jdbc.odbc.JdbcOdbcDriver (SQLServer)";
DrvArry[3] = "oracle.jdbc.driver.OracleDriver (Oracle)";
DrvArry[4] = "com.informix.jdbc.IfxDriver (Informix)";
DrvArry[5] = "twz1.jdbc.mysql.jdbcMysqlDriver (MySQL)";
DrvArry[6] = "org.gjt.mm.mysql.Driver (MySQL)";
DrvArry[7] = "com.sybase.jdbc2.jdbc.SybDriver (Sybase)";
DrvArry[8] = "COM.cloudscape.core.JDBCDriver (Cloudscape)";
DrvArry[9] = "postgresql.Driver (Postgre)";
DrvArry[10] = "intersolv.jdbc.sequelink.SequeLinkDriver (Oracle)";
DrvArry[11] = "intersolv.jdbc.sequelink.SequeLinkDriver (Informix)";
DrvArry[12] = "intersolv.jdbc.sequelink.SequeLinkDriver (Sybase)";
DrvArry[13] = "intersolv.jdbc.sequelink.SequeLinkDriver (SQLServer)";
DrvArry[14] = "intersolv.jdbc.sequelink.SequeLinkDriver (Access)";
DrvArry[15] = "openlink.jdbc2.Driver (SQLServer)";
//DrvArry(15) = "com.imaginary.sql.msql.MsqlDriver (MiniSQL)";
//DrvArry(16) = "solid.jdbc.SolidDriver";
//DrvArry(17) = "symantec.itools.db.jdbc.Driver";
%>
</HEAD>
<BODY bgcolor=silver>
<font size="4" face="Arial, Helvetica">
<b>Database's Operation Sample</b></font><br>
<hr size="1" color="#000000"><p>
<form name=form1 action="authors.asp?mode=1&direction=0" method=post>
<table align=center border=0 cellPadding=2 cellSpacing=0 width=90%>
<tr><td><strong>Dirver:</strong></td>
<td><select name=drvtxt onchange="drvtxt_onChange()">
<% for (i = 0; i < DrvArry.length; i++) {
if (i == drvIdx) { %>
<OPTION value=
<%=i%>
selected>
<%=DrvArry[i]%>
</OPTION>
<% } else {%>
<OPTION value=
<%=i%>
>
<%=DrvArry[i]%>
</OPTION>
<% }
}%>
</select> <input type=button name=OpenDB value="Open Database" onclick="return openCnn_onclick();">
</td>
</tr>
<tr><td><strong>Url:</strong></td>
<td><input type=text name=urltxt size=80 value=""></td>
</tr>
<tr><td><strong>User ID:</strong></td>
<td><input type=text name=uidtxt size=80 value=""></td>
</tr>
<tr><td><strong>Password:</strong></td>
<td><input type=password name=pwdtxt size=80 value=""></td>
</tr>
</table>
<INPUT TYPE=hidden name=pathInfo size=4 value="
<%=dbpath%>
">
</form>
<hr size="1" color="#000000"><p>
<P>
<table width=90% border=1 cellspacing=0>
<tr><td><b>Driver:</b></td><td><b>Database:</b></></tr>
<tr><td>sun.jdbc.odbc.JdbcOdbcDriver</td><td>Access, SQL Server</></tr>
<tr><td>oracle.jdbc.driver.OracleDriver</td><td>Oracle</></tr>
<tr><td>com.informix.jdbc.IfxDriver</td><td>Informix</></tr>
<tr><td>twz1.jdbc.mysql.jdbcMysqlDriver</td><td>MySQL</></tr>
<tr><td>org.gjt.mm.mysql.Driver</td><td>MySQL</></tr>
<tr><td>com.sybase.jdbc2.jdbc.SybDriver</td><td>Sybase</></tr>
<tr><td>COM.cloudscape.core.JDBCDriver</td><td>Cloudscape</></tr>
<tr><td>postgresql.Driver</td><td>Postgre</></tr>
<tr><td>intersolv.jdbc.sequelink.SequeLinkDriver</td><td>Oracle, Informix, Sybase, SQL Server, MS Access</td></tr>
<tr><td>openlink.jdbc2.Driver</td><td>SQL Server</></tr>
</table></P>
</BODY>
</HTML>
<SCRIPT language=JavaScript>
function openCnn_onclick(){
if (document.form1.drvtxt.selectedIndex == 0){
alert("Please select a driver for open database!");
return;
}
document.form1.submit();
}
function drvtxt_onChange(){
switch ( document.form1.drvtxt.selectedIndex ){
case 0:
document.form1.urltxt.value = "";
document.form1.uidtxt.value = "";
document.form1.pwdtxt.value = "";
break;
case 1:
document.form1.urltxt.value = "{jdbc:odbc:AccessDB}";
document.form1.uidtxt.value = "";
document.form1.pwdtxt.value = "";
break;
case 2:
document.form1.urltxt.value = "{jdbc:odbc:SQLServerDB}";
document.form1.uidtxt.value = "sa";
document.form1.pwdtxt.value = "";
break;
case 3:
document.form1.urltxt.value = "{jdbc:oracle:thin:@<HostIP>:1521:<SID>}";
document.form1.uidtxt.value = "HALCYON";
document.form1.pwdtxt.value = "HALCYON";
break;
case 4:
document.form1.urltxt.value = "{jdbc:informix-sqli://<HostIP>:1526/InformixDB:informixserver=kingdbsvr;user=informix;password=miss}";
document.form1.uidtxt.value = "";
document.form1.pwdtxt.value = "";
break;
case 5:
document.form1.urltxt.value = "{jdbc:z1MySQL://<HostIP>:3306/MySQLDB}";
document.form1.uidtxt.value = "root";
document.form1.pwdtxt.value = "";
break;
case 6:
document.form1.urltxt.value = "{jdbc:mysql://<HostIP>:3306/MySQLDB}";
document.form1.uidtxt.value = "root";
document.form1.pwdtxt.value = "";
break;
case 7:
document.form1.urltxt.value = "{jdbc:sybase:Tds:<HostIP>:5000/SybaseDB}";
document.form1.uidtxt.value = "sa";
document.form1.pwdtxt.value = "";
break;
case 8:
document.form1.urltxt.value = "{jdbc:cloudscape:" + document.form1.pathInfo.value;
document.form1.uidtxt.value = "";
document.form1.pwdtxt.value = "";
break;
case 9:
document.form1.urltxt.value = "{jdbc:postgresql://<HostIP>:5432/PostgresDB}";
document.form1.uidtxt.value = "postgres";
document.form1.pwdtxt.value = "post";
break;
case 10:
document.form1.urltxt.value = "{jdbc:sequelink://<HostIP>:4003/[Oracle];OSUser=john;OSPassword=whatever}";
document.form1.uidtxt.value = "HALCYON";
document.form1.pwdtxt.value = "HALCYON";
break;
case 11:
document.form1.urltxt.value = "{jdbc:sequelink://<HostIP>:4004/[Informix];Database=InformixDB;OSUser=john;OSPassword=whatever}";
document.form1.uidtxt.value = "";
document.form1.pwdtxt.value = "";
break;
case 12:
document.form1.urltxt.value = "{jdbc:sequelink://<HostIP>:4005/[Sybase];Database=SybaseDB;OSUser=john;OSPassword=whatever}";
document.form1.uidtxt.value = "sa";
document.form1.pwdtxt.value = "";
break;
case 13:
document.form1.urltxt.value = "{jdbc:sequelink://<HostIP>:4006/[SQLServer];Database=SQLServerDB;OSUser=john;OSPassword=whatever}";
document.form1.uidtxt.value = "sa";
document.form1.pwdtxt.value = "";
break;
case 14:
document.form1.urltxt.value = "{jdbc:sequelink://<HostIP>:4011/[ODBC MS Access];Database=c:\\database\\AccessDB.mdb;}";
document.form1.uidtxt.value = "";
document.form1.pwdtxt.value = "";
break;
case 15:
document.form1.urltxt.value = "{jdbc:openlink://<HostIP>/DSN=SQLServerDB/UID=sa/PWD=}";
document.form1.uidtxt.value = "";
document.form1.pwdtxt.value = "";
break;
case 16:
document.form1.urltxt.value = "{jdbc:msql://<HostIP>:1114/MiniSQLDB}";
document.form1.uidtxt.value = "";
document.form1.pwdtxt.value = "";
break;
case 17:
document.form1.urltxt.value = "{jdbc:solid://<HostIP>:<port>/<UID>/<PWD>}";
document.form1.uidtxt.value = "";
document.form1.pwdtxt.value = "";
break;
case 18:
document.form1.urltxt.value = "{jdbc:dbaw://< Host IP >:8889/MS_ACCESS/BIBLIO/BIBLIO}";
document.form1.uidtxt.value = "";
document.form1.pwdtxt.value = "";
}
}
</SCRIPT>