ഀ ഀ
View ASP Source code
ഀ
ഀ
ഀ ഀ
ഀ
ഀ
ഀ
ASP Source Code
ഀ
ASP File: ഀ vbscript/ado/animals/selectdb.asp
ഀ
ഀ
ഀ
ഀ
ഀ
ഀ
ഀ
ASP Script
ഀ
ഀ
ഀ
ഀ
Comments or Client-side ഀ Script
ഀ
ഀ
ഀ
HTML and Text
ഀ
ഀ
ഀ
<%@ ഀ Language=VBScript ഀ %>
<HTML>
<HEAD>
<TITLE>Animals ഀ Sample</TITLE>
<% dim ഀ path,dbpath,pos
path = ഀ Server.mappath("default.asp")
path = ഀ replace(path, "\", "/")
pos = ഀ InStr(1,path,"vbscript")
dbpath = Left(path,pos - 1) ഀ & "database/CloudscapeDB"
drvIdx = ഀ Request.QueryString("drvtxt")
dim DrvArry(14) ഀ '(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(9) = ഀ "intersolv.jdbc.sequelink.SequeLinkDriver (Oracle)"
ഀ DrvArry(10) = "intersolv.jdbc.sequelink.SequeLinkDriver ഀ (Informix)"
DrvArry(11) = ഀ "intersolv.jdbc.sequelink.SequeLinkDriver (Sybase)"
ഀ DrvArry(12) = "intersolv.jdbc.sequelink.SequeLinkDriver ഀ (SQLServer)"
DrvArry(13) = ഀ "intersolv.jdbc.sequelink.SequeLinkDriver (Access)"
ഀ DrvArry(14) = "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>
<form name=form1 action=main.asp ഀ 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 to ഀ ubound(DrvArry)
ഀ if i = drvIdx ഀ then%>
ഀ <OPTION value=
<%=i%>
selected>
<%=DrvArry(i)%>
</OPTION>
ഀ
<%else%>
ഀ <OPTION value=
<%=i%>
>
<%=DrvArry(i)%>
</OPTION>
ഀ
<%end ഀ if%>
ഀ
<%next%>
ഀ </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>
</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:
<%=dbpath%>
}";
ഀ 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 ഀ 9:
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 ഀ 10:
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 ഀ 11:
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 ഀ 12:
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 ഀ 13:
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 ഀ 14:
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>
ഀ
ഀ
ഀ
ഀ