{"id":2306,"date":"2014-12-18T19:37:00","date_gmt":"2014-12-18T19:37:00","guid":{"rendered":"https:\/\/alt2.minisoft.com\/support\/?p=2306"},"modified":"2016-12-02T22:31:59","modified_gmt":"2016-12-02T22:31:59","slug":"active-server-pages","status":"publish","type":"post","link":"https:\/\/c002.minisoft.com\/support\/active-server-pages\/","title":{"rendered":"Active Server Pages"},"content":{"rendered":"<p>The following is one example of using Minisoft&#8217;s ODBC driver to access HP e3000 Image files from any web browser. This example uses ADO objects to access the driver. The example consists of two files. The first is a form used to request data. The second is the ASP code used to retrieve data.<\/p>\n<p>Download this sample: [<a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2014\/12\/odbc32r.zip\"> <span style=\"color: #990000;\">HTTP<\/span><\/a>]<\/p>\n<hr size=\"1\" \/>\n<p class=\"subheads\"><strong>The newasp.html file:<\/strong><\/p>\n<p>&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;title&gt;Query Form&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;form action=&#8221;MSDB_1.ASP&#8221; method=&#8221;GET&#8221;&gt;<br \/>\n&lt;p&gt;&lt;select name=&#8221;Param&#8221; size=&#8221;1&#8243;&gt;<br \/>\n&lt;option selected value=&#8221;CUSTOMER_NUMBER&#8221;&gt;Contact Number&lt;\/option&gt;<br \/>\n&lt;option value=&#8221;CONTACT_NUMBER&#8221;&gt;Contact Number&lt;\/option&gt;<br \/>\n&lt;option value=&#8221;LAST_NAME&#8221;&gt;Last Name&lt;\/option&gt;<br \/>\n&lt;option value=&#8221;FIRST_NAME&#8221;&gt;First Name&lt;\/option&gt;<br \/>\n&lt;\/select&gt;&lt;\/p&gt;<br \/>\n&lt;p&gt;&lt;input type=&#8221;text&#8221; size=&#8221;20&#8243; name=&#8221;Data&#8221;&gt;&lt;\/p&gt;<br \/>\n&lt;p&gt;&lt;input type=&#8221;submit&#8221; value=&#8221;Button&#8221;&gt;&lt;\/p&gt;<br \/>\n&lt;\/form&gt;<\/p>\n<p>&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<code><a name=\"asp\"><\/a>\u00a0<\/code><\/p>\n<hr size=\"1\" \/>\n<p class=\"subheads\"><strong>The msdb_1.asp file:<\/strong><\/p>\n<p><code>&lt;html&gt;<\/code><\/p>\n<p>&lt;head&gt;<br \/>\n&lt;meta HTTP-EQUIV=&#8221;Content-Type&#8221; CONTENT=&#8221;text\/html;charset=windows-1252&#8243;&gt;<br \/>\n&lt;title&gt;MSDB CONTACTS&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<br \/>\n&lt;%<br \/>\nParam = Request.QueryString(&#8220;Param&#8221;)<br \/>\nData = Request.QueryString(&#8220;Data&#8221;)<br \/>\n&#8216;<br \/>\n&#8216; Session (global) variable names used in this sample:<br \/>\n&#8216; MSDB_Conn = Used to store the open connection<br \/>\n&#8216; between successive calls to<br \/>\n&#8216; this page.<br \/>\n&#8216;<br \/>\n&#8216; Local variable names used in this sample:<br \/>\n&#8216; Param = string value from the form used to call this<br \/>\n&#8216; page. Used to hold the name of the key to perform<br \/>\n&#8216; an optional lookup.<br \/>\n&#8216; Data = string value from the form used to call this<br \/>\n&#8216; page. Used to hold the value of the key for lookups.<br \/>\n&#8216; conn = object created from ADO.<br \/>\n&#8216; sql = string to hold the SQL Select statement.<br \/>\n&#8216; rs = object used to hold the result set of the<br \/>\n&#8216; SQL Select.<br \/>\n&#8216;<br \/>\n%&gt;<br \/>\n&lt;%<br \/>\n&#8216;<br \/>\n&#8216; This section checks to see if a connection has<br \/>\n&#8216; already been established.<br \/>\n&#8216; If it has, conn is assigned the old connection. If<br \/>\n&#8216; not, the connection object is created, assigned to<br \/>\n&#8216; conn, and the session vaiable created.<br \/>\n&#8216;<br \/>\nIf IsObject(Session(&#8220;MSDB_conn&#8221;)) Then<br \/>\nSet conn = Session(&#8220;MSDB_conn&#8221;)<br \/>\nElse<br \/>\nSet conn = Server.CreateObject(&#8220;ADODB.Connection&#8221;)<br \/>\nconn.open &#8220;MSDB&#8221;<br \/>\nSet Session(&#8220;MSDB_conn&#8221;) = conn<br \/>\nEnd If<\/p>\n<p>%&gt;<br \/>\n&lt;%<br \/>\n&#8216;<br \/>\n&#8216; Here we create the SELECT statement and optionaly<br \/>\n&#8216; add the criteria.<br \/>\n&#8216;<br \/>\nsql = &#8220;SELECT * FROM CONTACTS&#8221;<br \/>\nIf cstr(Param) &lt;&gt; &#8220;&#8221; And cstr(Data) &lt;&gt; &#8220;&#8221; Then<br \/>\nsql = sql &amp; &#8221; WHERE &#8221; &amp; cstr(Param) &amp; &#8221; = &#8216;&#8221; &amp; right(&#8220;000000&#8243;+trim(cstr(Data)),6) &amp; &#8220;&#8216;&#8221;<br \/>\nEnd If<br \/>\nSet rs = Server.CreateObject(&#8220;ADODB.Recordset&#8221;)<br \/>\nrs.Open sql, conn, 3, 3<br \/>\n%&gt;<\/p>\n<p>&lt;table&gt;<br \/>\n&lt;caption&gt;MSDB CONTACTS&lt;\/caption&gt;<br \/>\n&lt;THEAD&gt;<br \/>\n&lt;tr&gt;<br \/>\n&lt;th&gt;&lt;%=Server.HTMLEncode(rs.Fields(0).Name)%&gt;<br \/>\n&lt;\/th&gt;<br \/>\n&lt;th&gt;&lt;%=Server.HTMLEncode(rs.Fields(1).Name)%&gt;<br \/>\n&lt;\/th&gt;<br \/>\n&lt;th&gt;&lt;%=Server.HTMLEncode(rs.Fields(2).Name)%&gt;<br \/>\n&lt;\/th&gt;<br \/>\n&lt;th&gt;&lt;%=Server.HTMLEncode(rs.Fields(3).Name)%&gt;<br \/>\n&lt;\/th&gt;<br \/>\n&lt;th&gt;&lt;%=Server.HTMLEncode(rs.Fields(4).Name)%&gt;<br \/>\n&lt;\/th&gt;<br \/>\n&lt;th&gt;&lt;%=Server.HTMLEncode(rs.Fields(5).Name)%&gt;<br \/>\n&lt;\/th&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;\/THEAD&gt;<br \/>\n&lt;TBODY&gt;<br \/>\n&lt;%<br \/>\n&#8216;<br \/>\n&#8216; For each record in the result set (rs) a row of<br \/>\n&#8216; the table is added.<br \/>\n&#8216;<br \/>\nOn Error Resume Next<br \/>\nrs.MoveFirst<br \/>\ndo while Not rs.eof<br \/>\n%&gt;<br \/>\n&lt;tr VALIGN=&#8221;TOP&#8221;&gt;<br \/>\n&lt;td&gt;&lt;%=Server.HTMLEncode(rs.Fields(0).Value)%&gt;<br \/>\n&lt;\/td&gt;<br \/>\n&lt;td&gt;&lt;%=Server.HTMLEncode(rs.Fields(1).Value)%&gt;<br \/>\n&lt;\/td&gt;<br \/>\n&lt;td&gt;&lt;%=Server.HTMLEncode(rs.Fields(2).Value)%&gt;<br \/>\n&lt;\/td&gt;<br \/>\n&lt;td&gt;&lt;%=Server.HTMLEncode(rs.Fields(3).Value)%&gt;<br \/>\n&lt;\/td&gt;<br \/>\n&lt;td&gt;&lt;%=Server.HTMLEncode(rs.Fields(4).Value)%&gt;<br \/>\n&lt;\/td&gt;<br \/>\n&lt;td&gt;&lt;%=Server.HTMLEncode(rs.Fields(5).Value)%&gt;<br \/>\n&lt;\/td&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;%<br \/>\nrs.MoveNext<br \/>\nloop<br \/>\n%&gt;<br \/>\n&lt;\/TBODY&gt;<br \/>\n&lt;TFOOT&gt;<br \/>\n&lt;tr&gt;<br \/>\n&lt;td colspan=&#8221;6&#8243;&gt;SQL=&amp;quot;&lt;%=sql%&gt;&amp;quot;&lt;\/td&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;\/TFOOT&gt;<br \/>\n&lt;\/table&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following is one example of using Minisoft&#8217;s ODBC driver to access HP e3000 Image files from any web browser. This example uses ADO objects to access the driver. The example consists of two files. The first is a form used to request data. The second is the ASP code used to retrieve data. Download [&hellip;]<\/p>\n","protected":false},"author":75,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54,63],"tags":[],"_links":{"self":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/2306"}],"collection":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/users\/75"}],"replies":[{"embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/comments?post=2306"}],"version-history":[{"count":4,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/2306\/revisions"}],"predecessor-version":[{"id":4504,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/2306\/revisions\/4504"}],"wp:attachment":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/media?parent=2306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/categories?post=2306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/tags?post=2306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}