<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[[最后的Code]谁说asp没用---oracle+asp+iis连接代码]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Mon, 16 Oct 2006 12:10:05 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	本人通过虚拟两台电脑,一台安装oracle 9i;另一台安装IIS跑asp.然后用数据源来连接虚拟的Oracle 9i,弄好后用DW来自动生成代码,结果测试良好.就是数据与程序分离的典型.望大家尽量;<br/><br/>oracletest.asp<br/>code:位于connection 文件夹下:<br/><br/>&lt;%<br/>&#039; FileName=&quot;Connection_odbc_conn_dsn.htm&quot;<br/>&#039; Type=&quot;ADO&quot; <br/>&#039; DesigntimeType=&quot;ADO&quot;<br/>&#039; HTTP=&quot;false&quot;<br/>&#039; Catalog=&quot;&quot;<br/>&#039; Schema=&quot;&quot;<br/>Dim MM_oracle_STRING<br/>MM_oracle_STRING = &quot;dsn=oracle9;uid=system;pwd=manager;&quot;<br/>%&gt;<br/><br/><br/><br/>oracletest.asp<br/>code:<br/>&lt;%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;936&quot;%&gt;<br/>&lt;!--#include file=&quot;Connections/oracle.asp&quot; --&gt;<br/>&lt;%<br/>&#039; *** Edit Operations: declare variables<br/><br/>Dim MM_editAction<br/>Dim MM_abortEdit<br/>Dim MM_editQuery<br/>Dim MM_editCmd<br/><br/>Dim MM_editConnection<br/>Dim MM_editTable<br/>Dim MM_editRedirectUrl<br/>Dim MM_editColumn<br/>Dim MM_recordId<br/><br/>Dim MM_fieldsStr<br/>Dim MM_columnsStr<br/>Dim MM_fields<br/>Dim MM_columns<br/>Dim MM_typeArray<br/>Dim MM_formVal<br/>Dim MM_delim<br/>Dim MM_altVal<br/>Dim MM_emptyVal<br/>Dim MM_i<br/><br/>MM_editAction = CStr(Request.ServerVariables(&quot;SCRIPT_NAME&quot;))<br/>If (Request.QueryString &lt;&gt; &quot;&quot;) Then<br/> &nbsp;MM_editAction = MM_editAction &amp; &quot;?&quot; &amp; Server.HTMLEncode(Request.QueryString)<br/>End If<br/><br/>&#039; boolean to abort record edit<br/>MM_abortEdit = false<br/><br/>&#039; query string to execute<br/>MM_editQuery = &quot;&quot;<br/>%&gt;<br/>&lt;%<br/>&#039; *** Insert Record: set variables<br/><br/>If (CStr(Request(&quot;MM_insert&quot;)) = &quot;form1&quot;) Then<br/><br/> &nbsp;MM_editConnection = MM_oracle_STRING<br/> &nbsp;MM_editTable = &quot;HR.JOBS&quot;<br/> &nbsp;MM_editRedirectUrl = &quot;file:///C&amp;#124;/Inetpub/wwwroot/oracletest/iisstart.htm&quot;<br/> &nbsp;MM_fieldsStr &nbsp;= &quot;textfield&amp;#124;value&amp;#124;textfield2&amp;#124;value&amp;#124;textfield3&amp;#124;value&amp;#124;textfield4&amp;#124;value&quot;<br/> &nbsp;MM_columnsStr = &quot;JOB_ID&amp;#124;&#039;,none,&#039;&#039;&amp;#124;JOB_TITLE&amp;#124;&#039;,none,&#039;&#039;&amp;#124;MIN_SALARY&amp;#124;none,none,NULL&amp;#124;MAX_SALARY&amp;#124;none,none,NULL&quot;<br/><br/> &nbsp;&#039; create the MM_fields and MM_columns arrays<br/> &nbsp;MM_fields = Split(MM_fieldsStr, &quot;&amp;#124;&quot;)<br/> &nbsp;MM_columns = Split(MM_columnsStr, &quot;&amp;#124;&quot;)<br/> &nbsp;<br/> &nbsp;&#039; set the form values<br/> &nbsp;For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2<br/> &nbsp; &nbsp;MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))<br/> &nbsp;Next<br/><br/> &nbsp;&#039; append the query string to the redirect URL<br/> &nbsp;If (MM_editRedirectUrl &lt;&gt; &quot;&quot; And Request.QueryString &lt;&gt; &quot;&quot;) Then<br/> &nbsp; &nbsp;If (InStr(1, MM_editRedirectUrl, &quot;?&quot;, vbTextCompare) = 0 And Request.QueryString &lt;&gt; &quot;&quot;) Then<br/> &nbsp; &nbsp; &nbsp;MM_editRedirectUrl = MM_editRedirectUrl &amp; &quot;?&quot; &amp; Request.QueryString<br/> &nbsp; &nbsp;Else<br/> &nbsp; &nbsp; &nbsp;MM_editRedirectUrl = MM_editRedirectUrl &amp; &quot;&amp;&quot; &amp; Request.QueryString<br/> &nbsp; &nbsp;End If<br/> &nbsp;End If<br/><br/>End If<br/>%&gt;<br/>&lt;%<br/>&#039; *** Insert Record: construct a sql insert statement and execute it<br/><br/>Dim MM_tableValues<br/>Dim MM_dbValues<br/><br/>If (CStr(Request(&quot;MM_insert&quot;)) &lt;&gt; &quot;&quot;) Then<br/><br/> &nbsp;&#039; create the sql insert statement<br/> &nbsp;MM_tableValues = &quot;&quot;<br/> &nbsp;MM_dbValues = &quot;&quot;<br/> &nbsp;For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2<br/> &nbsp; &nbsp;MM_formVal = MM_fields(MM_i+1)<br/> &nbsp; &nbsp;MM_typeArray = Split(MM_columns(MM_i+1),&quot;,&quot;)<br/> &nbsp; &nbsp;MM_delim = MM_typeArray(0)<br/> &nbsp; &nbsp;If (MM_delim = &quot;none&quot;) Then MM_delim = &quot;&quot;<br/> &nbsp; &nbsp;MM_altVal = MM_typeArray(1)<br/> &nbsp; &nbsp;If (MM_altVal = &quot;none&quot;) Then MM_altVal = &quot;&quot;<br/> &nbsp; &nbsp;MM_emptyVal = MM_typeArray(2)<br/> &nbsp; &nbsp;If (MM_emptyVal = &quot;none&quot;) Then MM_emptyVal = &quot;&quot;<br/> &nbsp; &nbsp;If (MM_formVal = &quot;&quot;) Then<br/> &nbsp; &nbsp; &nbsp;MM_formVal = MM_emptyVal<br/> &nbsp; &nbsp;Else<br/> &nbsp; &nbsp; &nbsp;If (MM_altVal &lt;&gt; &quot;&quot;) Then<br/> &nbsp; &nbsp; &nbsp; &nbsp;MM_formVal = MM_altVal<br/> &nbsp; &nbsp; &nbsp;ElseIf (MM_delim = &quot;&#039;&quot;) Then &nbsp;&#039; escape quotes<br/> &nbsp; &nbsp; &nbsp; &nbsp;MM_formVal = &quot;&#039;&quot; &amp; Replace(MM_formVal,&quot;&#039;&quot;,&quot;&#039;&#039;&quot;) &amp; &quot;&#039;&quot;<br/> &nbsp; &nbsp; &nbsp;Else<br/> &nbsp; &nbsp; &nbsp; &nbsp;MM_formVal = MM_delim + MM_formVal + MM_delim<br/> &nbsp; &nbsp; &nbsp;End If<br/> &nbsp; &nbsp;End If<br/> &nbsp; &nbsp;If (MM_i &lt;&gt; LBound(MM_fields)) Then<br/> &nbsp; &nbsp; &nbsp;MM_tableValues = MM_tableValues &amp; &quot;,&quot;<br/> &nbsp; &nbsp; &nbsp;MM_dbValues = MM_dbValues &amp; &quot;,&quot;<br/> &nbsp; &nbsp;End If<br/> &nbsp; &nbsp;MM_tableValues = MM_tableValues &amp; MM_columns(MM_i)<br/> &nbsp; &nbsp;MM_dbValues = MM_dbValues &amp; MM_formVal<br/> &nbsp;Next<br/> &nbsp;MM_editQuery = &quot;insert into &quot; &amp; MM_editTable &amp; &quot; (&quot; &amp; MM_tableValues &amp; &quot;) values (&quot; &amp; MM_dbValues &amp; &quot;)&quot;<br/><br/> &nbsp;If (Not MM_abortEdit) Then<br/> &nbsp; &nbsp;&#039; execute the insert<br/> &nbsp; &nbsp;Set MM_editCmd = Server.CreateObject(&quot;ADODB.Command&quot;)<br/> &nbsp; &nbsp;MM_editCmd.ActiveConnection = MM_editConnection<br/> &nbsp; &nbsp;MM_editCmd.CommandText = MM_editQuery<br/> &nbsp; &nbsp;MM_editCmd.Execute<br/> &nbsp; &nbsp;MM_editCmd.ActiveConnection.Close<br/><br/> &nbsp; &nbsp;If (MM_editRedirectUrl &lt;&gt; &quot;&quot;) Then<br/> &nbsp; &nbsp; &nbsp;Response.Redirect(MM_editRedirectUrl)<br/> &nbsp; &nbsp;End If<br/> &nbsp;End If<br/><br/>End If<br/>%&gt;<br/>&lt;%<br/>Dim Recordset1<br/>Dim Recordset1_numRows<br/><br/>Set Recordset1 = Server.CreateObject(&quot;ADODB.Recordset&quot;)<br/>Recordset1.ActiveConnection = MM_oracle_STRING<br/>Recordset1.Source = &quot;SELECT JOB_ID, JOB_TITLE, MIN_SALARY, MAX_SALARY FROM HR.JOBS&quot;<br/>Recordset1.CursorType = 0<br/>Recordset1.CursorLocation = 2<br/>Recordset1.LockType = 1<br/>Recordset1.Open()<br/><br/>Recordset1_numRows = 0<br/>%&gt;<br/>&lt;%<br/>Dim Repeat1__numRows<br/>Dim Repeat1__index<br/><br/>Repeat1__numRows = -1<br/>Repeat1__index = 0<br/>Recordset1_numRows = Recordset1_numRows + Repeat1__numRows<br/>%&gt;<br/><br/><br/><br/>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br/>&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br/>&lt;head&gt;<br/>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;<br/>&lt;title&gt;无标题文档&lt;/title&gt;<br/>&lt;/head&gt;<br/><br/>&lt;body&gt;<br/>&lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;POST&quot; action=&quot;&lt;%=MM_editAction%&gt;&quot;&gt;<br/> &nbsp;&lt;label&gt;<br/> &nbsp;&lt;input type=&quot;text&quot; name=&quot;textfield&quot; /&gt;<br/> &nbsp;&lt;/label&gt;<br/> &nbsp;&lt;p&gt;<br/> &nbsp; &nbsp;&lt;input type=&quot;text&quot; name=&quot;textfield2&quot; /&gt;<br/> &nbsp;&lt;/p&gt;<br/> &nbsp;&lt;p&gt;<br/> &nbsp; &nbsp;&lt;input type=&quot;text&quot; name=&quot;textfield3&quot; /&gt;<br/> &nbsp;&lt;/p&gt;<br/> &nbsp;&lt;p&gt;<br/> &nbsp; &nbsp;&lt;input type=&quot;text&quot; name=&quot;textfield4&quot; /&gt;<br/> &nbsp;&lt;/p&gt;<br/> &nbsp;&lt;p&gt;<br/> &nbsp; &nbsp;&lt;label&gt;<br/> &nbsp; &nbsp;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;提交&quot; /&gt;<br/> &nbsp; &nbsp;&lt;/label&gt;<br/>&lt;/p&gt;<br/><br/> &nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;MM_insert&quot; value=&quot;form1&quot;&gt;<br/>&lt;/form&gt;<br/>&lt;p&gt; &lt;/p&gt;<br/>&lt;p&gt; &lt;/p&gt;<br/><br/>&lt;table border=&quot;1&quot;&gt;<br/> &nbsp;&lt;tr&gt;<br/> &nbsp; &nbsp;&lt;td&gt;JOB_ID&lt;/td&gt;<br/> &nbsp; &nbsp;&lt;td&gt;JOB_TITLE&lt;/td&gt;<br/> &nbsp; &nbsp;&lt;td&gt;MIN_SALARY&lt;/td&gt;<br/> &nbsp; &nbsp;&lt;td&gt;MAX_SALARY&lt;/td&gt;<br/> &nbsp;&lt;/tr&gt;<br/> &nbsp;&lt;% While ((Repeat1__numRows &lt;&gt; 0) AND (NOT Recordset1.EOF)) %&gt;<br/> &nbsp; &nbsp;&lt;tr&gt;<br/> &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;%=(Recordset1.Fields.Item(&quot;JOB_ID&quot;).Value)%&gt;&lt;/td&gt;<br/> &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;%=(Recordset1.Fields.Item(&quot;JOB_TITLE&quot;).Value)%&gt;&lt;/td&gt;<br/> &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;%=(Recordset1.Fields.Item(&quot;MIN_SALARY&quot;).Value)%&gt;&lt;/td&gt;<br/> &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;%=(Recordset1.Fields.Item(&quot;MAX_SALARY&quot;).Value)%&gt;&lt;/td&gt;<br/> &nbsp; &nbsp;&lt;/tr&gt;<br/> &nbsp; &nbsp;&lt;% <br/> &nbsp;Repeat1__index=Repeat1__index+1<br/> &nbsp;Repeat1__numRows=Repeat1__numRows-1<br/> &nbsp;Recordset1.MoveNext()<br/>Wend<br/>%&gt;<br/>&lt;/table&gt;<br/>&lt;/body&gt;<br/>&lt;/html&gt;<br/>&lt;%<br/>Recordset1.Close()<br/>Set Recordset1 = Nothing<br/>%&gt;<br/><br/><br/><br/><br/><br/>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [最后的Code]谁说asp没用---oracle+asp+iis连接代码]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>