PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/SQL/scripts/conn/dsnless.asp

http://github.com/khaneh/Orders
ASP | 107 lines | 98 code | 7 blank | 2 comment | 1 complexity | 2244f4cb18760d241e1d9e7daf148495 MD5 | raw file
  1<!-- #INCLUDE FILE="../inc/mla_sql_include.asp" -->
  2
  3<%
  4	Dim myStrTree, myConnStr
  5	myStrTree = getTreeStr("1_1", Array())
  6
  7	If Request.Form("mla_conn_submit") <> "" Then
  8		' saves connection info into a cookie
  9		If Request.Form("mla_conn_cookie") <> "" Then
 10			Response.Cookies("ConnStr")("Provider") = Request.Form("mla_conn_provider")
 11			Response.Cookies("ConnStr")("Datasource") = Request.Form("mla_conn_datasource")
 12			Response.Cookies("ConnStr")("Portnumber") = Request.Form("mla_conn_portnumber")
 13			Response.Cookies("ConnStr")("Networklibrary") = Request.Form("mla_conn_networklibrary")
 14			Response.Cookies("ConnStr")("Initialcatalog") = Request.Form("mla_conn_initialcatalog")
 15			Response.Cookies("ConnStr")("Trusted") = Request.Form("mla_conn_trusted")
 16			Response.Cookies("ConnStr")("User") = Request.Form("mla_conn_user")
 17			Response.Cookies("ConnStr")("Password") = Request.Form("mla_conn_password")
 18			Response.Cookies("ConnStr").Expires = #1/1/2020#
 19		End If
 20		' creates connection string
 21		myConnStr = mla_getConnStr(Request.Form("mla_conn_provider"), Request.Form("mla_conn_datasource"), Request.Form("mla_conn_portnumber"), Request.Form("mla_conn_networklibrary"), Request.Form("mla_conn_initialcatalog"), Request.Form("mla_conn_trusted"), Request.Form("mla_conn_user"), Request.Form("mla_conn_password"))
 22		Session("isConnected") = True
 23		Session("ConnStr") = myConnStr
 24		Response.Redirect "../hlp/connected.asp?refresh=1"
 25		Response.End
 26	End If
 27%>
 28
 29<!-- #INCLUDE FILE="../inc/metaheader.asp" -->
 30<BODY>
 31<P CLASS="treeinfo"><% = myStrTree %></P>
 32
 33<FORM NAME="mla_conn" METHOD=POST ACTION="dsnless.asp">
 34	<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 CLASS="hcontent" SUMMARY="Connection Form">
 35		<TR><TD CLASS="caption" COLSPAN=4><IMG SRC="../../themes/<% = mla_cfg_theme %>/images/mylittletree/server.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALIGN="MIDDLE" ALT="Connection"> <% = myTObj.getTerm(2) %></TD></TR>
 36		<TR>
 37			<TD CLASS="formlabel"><% = myTObj.getTerm(100) %> :</TD>
 38			<TD><INPUT TYPE="text" NAME="mla_conn_datasource" CLASS="alphanumeric" TITLE="<% = myTObj.getTerm(100) %>"></TD>
 39			<TD CLASS="formlabel"><% = myTObj.getTerm(101) %> :</TD>
 40			<TD><INPUT TYPE="text" NAME="mla_conn_portnumber" CLASS="numeric" TITLE="<% = myTObj.getTerm(101) %>"></TD>
 41		</TR>
 42		<TR>
 43			<TD CLASS="formlabel"><% = myTObj.getTerm(102) %> :</TD>
 44			<TD COLSPAN=3><INPUT TYPE="text" NAME="mla_conn_initialcatalog" CLASS="alphanumeric" TITLE="<% = myTObj.getTerm(102) %>"></TD>
 45		</TR>
 46		<TR>
 47			<TD CLASS="formlabel"><% = myTObj.getTerm(103) %> :</TD>
 48			<TD COLSPAN=3>
 49				<INPUT TYPE="radio" NAME="mla_conn_provider" VALUE="SQLOLEDB" ID="mla_conn_provider_1" CHECKED><LABEL FOR="mla_conn_provider_1">SQLOLEDB</LABEL> &nbsp; 
 50				<INPUT TYPE="radio" NAME="mla_conn_provider" VALUE="ODBC" ID="mla_conn_provider_2"><LABEL FOR="mla_conn_provider_2">ODBC</LABEL>
 51			</TD>
 52		</TR>
 53		<TR>
 54			<TD CLASS="formlabel"><% = myTObj.getTerm(104) %> :</TD>
 55			<TD>
 56				<SELECT NAME="mla_conn_networklibrary">
 57					<OPTION VALUE="">Default</OPTION>
 58					<OPTION VALUE="dbnmpntw">Named Pipes</OPTION>
 59					<OPTION VALUE="dbmssocn">Winsock TCP/IP</OPTION>
 60					<OPTION VALUE="dbmsspxn">SPX/IPX</OPTION>
 61					<OPTION VALUE="dbmsvinn">Banyan Vines</OPTION>
 62					<OPTION VALUE="dbmsrpcn">Multi-Protocol (RPC)</OPTION>
 63				</SELECT>
 64			</TD>
 65			<TD CLASS="formlabel"><% = myTObj.getTerm(105) %> :</TD>
 66			<TD><INPUT TYPE="checkbox" NAME="mla_conn_trusted"></TD>
 67		</TR>
 68		<TR>
 69			<TD CLASS="formlabel"><% = myTObj.getTerm(106) %> :</TD>
 70			<TD COLSPAN=3><INPUT TYPE="text" NAME="mla_conn_user" CLASS="alphanumeric" TITLE="<% = myTObj.getTerm(106) %>"></TD>
 71		</TR>
 72		<TR>
 73			<TD CLASS="formlabel"><% = myTObj.getTerm(107) %> :</TD>
 74			<TD COLSPAN=3><INPUT TYPE="password" NAME="mla_conn_password" CLASS="alphanumeric" TITLE="<% = myTObj.getTerm(107) %>"></TD>
 75		</TR>
 76		<TR><TD COLSPAN=4>&nbsp;</TD></TR>
 77		<TR>
 78			<TD COLSPAN=3 CLASS="formlabel"><% = myTObj.getTerm(108) %> :</TD><TD><INPUT TYPE="checkbox" NAME="mla_conn_cookie"></TD>
 79		</TR>
 80		<TR><TD COLSPAN=4>&nbsp;</TD></TR>
 81		<TR>
 82			<TD COLSPAN=4 ALIGN=CENTER>
 83				<INPUT TYPE="reset" VALUE="<% = myTObj.getTerm(50) %>" NAME="mla_conn_reset"> &nbsp;
 84				<INPUT TYPE="submit" VALUE="<% = myTObj.getTerm(109) %>" NAME="mla_conn_submit">
 85			</TD>
 86		</TR>
 87	</TABLE>
 88</FORM>
 89
 90<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
 91<!--
 92	document.mla_conn.mla_conn_datasource.value = "<% = remdquote(Request.Cookies("ConnStr")("Datasource")) %>";
 93	document.mla_conn.mla_conn_portnumber.value = "<% = remdquote(Request.Cookies("ConnStr")("Portnumber")) %>";
 94	setRadioValue(document.mla_conn.mla_conn_provider, "<% = Request.Cookies("ConnStr")("Provider") %>", "");
 95	setSelectValue(document.mla_conn.mla_conn_networklibrary, "<% = Request.Cookies("ConnStr")("Networklibrary") %>", "");
 96	document.mla_conn.mla_conn_initialcatalog.value = "<% = remdquote(Request.Cookies("ConnStr")("Initialcatalog")) %>";
 97	document.mla_conn.mla_conn_trusted.checked = <% If Request.Cookies("ConnStr")("Trusted") = "" Then Response.Write "false" Else Response.Write "true" End If%>;
 98	document.mla_conn.mla_conn_user.value = "<% = remdquote(Request.Cookies("ConnStr")("User")) %>";
 99	document.mla_conn.mla_conn_password.value = "<% = remdquote(Request.Cookies("ConnStr")("Password")) %>";
100
101	if (window.parent.frames['Tree']) window.parent.frames['Tree'].oTree.expandNode('M1'); 
102//-->
103</SCRIPT>
104
105</BODY>
106</HTML>
107<!-- #INCLUDE FILE="../inc/mla_sql_end.asp" -->