﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-Jervis</title><link>http://www.cnitblog.com/Jervis/</link><description /><language>zh-cn</language><lastBuildDate>Wed, 29 Apr 2026 10:11:40 GMT</lastBuildDate><pubDate>Wed, 29 Apr 2026 10:11:40 GMT</pubDate><ttl>60</ttl><item><title>朋友的又一个小网站</title><link>http://www.cnitblog.com/Jervis/archive/2006/08/16/15363.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Wed, 16 Aug 2006 06:56:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2006/08/16/15363.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/15363.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2006/08/16/15363.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/15363.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/15363.html</trackback:ping><description><![CDATA[
		<a href="http://www.sh-jevin.com">www.sh-jevin.com</a>
		<br />纯粹公司小网站<img src ="http://www.cnitblog.com/Jervis/aggbug/15363.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2006-08-16 14:56 <a href="http://www.cnitblog.com/Jervis/archive/2006/08/16/15363.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>as电影剪辑移动</title><link>http://www.cnitblog.com/Jervis/archive/2006/04/29/9938.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Sat, 29 Apr 2006 09:02:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2006/04/29/9938.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/9938.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2006/04/29/9938.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/9938.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/9938.html</trackback:ping><description><![CDATA[//甘盛浩-保存<br />function mcMove(mc:MovieClip, stopX:Number) {<br /> // Xposzhiwu<br /> var tmpx = mc._x;<br /> mc.onEnterFrame = function() {<br />  if (tmpx &lt;&gt; stopX) {<br />   tmpx = tmpx + (stopX - tmpx) / 5;<br />   if (Math.abs(stopX - tmpx) &lt; 1) {<br />    tmpx = stopX;<br />   }<br />   mc._x = tmpx;<br />  } else {<br />   delete this.onEnterFrame;<br />  }<br /> };<br />}<img src ="http://www.cnitblog.com/Jervis/aggbug/9938.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2006-04-29 17:02 <a href="http://www.cnitblog.com/Jervis/archive/2006/04/29/9938.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>圣诞了快快剪</title><link>http://www.cnitblog.com/Jervis/archive/2005/12/23/5723.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Fri, 23 Dec 2005 07:50:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2005/12/23/5723.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/5723.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2005/12/23/5723.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/5723.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/5723.html</trackback:ping><description><![CDATA[<A href="http://snowflakes.lookandfeel.com/">http://snowflakes.lookandfeel.com/</A><img src ="http://www.cnitblog.com/Jervis/aggbug/5723.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2005-12-23 15:50 <a href="http://www.cnitblog.com/Jervis/archive/2005/12/23/5723.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ASP生成静态页面的方法</title><link>http://www.cnitblog.com/Jervis/archive/2005/12/04/5119.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Sun, 04 Dec 2005 04:50:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2005/12/04/5119.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/5119.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2005/12/04/5119.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/5119.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/5119.html</trackback:ping><description><![CDATA[我希望大家看到该标题就能让想象到它的功能：<BR><BR>1，WITH&nbsp;TEMPLET意思是，生成的页面架构将采用某个已设定的模板，在此之前我的一篇教程中介绍过，希望各位在看本教程之前对ASP采用模板应熟悉下。（当然，不看也没有问题，本教程同样会提及精华部分的：）具体参考：<A href="http://www.cnbruce.com/blog/showlog.asp?cat_id=26&amp;log_id=474&nbsp;" target=_blank>http://www.cnbruce.com/blog/showlog.asp?cat_id=26&amp;log_id=474&nbsp;</A><BR><BR>2，ASP2HTML。不要我再说ASP转变成HTML的好处了吧，呵呵，其中最值得知道的就是：静态HTML页和动态页对服务器的要求承受能力小得多，同样，静态HTML搜索几率远比动态页面的多得多。<BR><BR>那么，我现在需要处理的技术问题就是：<BR>1，如何实现模板技术？（先参看下上篇文章吧）<BR>2，如何实现2HTML技术？<BR>3，如何让模板技术与2HTML技术结合？<BR><BR>一、先进行技术原理分析<BR><BR>1，模板技术参看&nbsp;www.cnbruce.com/blog/showlog.asp?cat_id=26&amp;log_id=474&nbsp;<BR><BR>2，2HTML技术又该如何实现呢？如何使得ASP页面转变为HTML？一般都会想到FSO组件，因为该组件能新建任何文件格式。<BR><BR>那么其整个运行过程是怎么样的呢？<BR>a，提供信息输入页面进行信息收集；<BR>b，接受信息值先保存数据库，再FSO生成文件；<BR>c，技术性完成任务，显示刚被创建的HTML文件的路径地址。<BR><BR>该技术的实现过程中有如下几个难点：<BR><BR>i，FSO生成的文件是直接放在一个大文件夹下，还是单独放在某个每日更新的子文件夹中？可能表述不准确，这样理解吧：相信通过FSO生成的文件随着时间的推移，文件会越来越多，管理也会越来越乱……通常你可能看到一些地址诸如&nbsp;www.xxx.com/a/2004-5-20/200405201111.html&nbsp;可以分析得出应该是建立了当前日期的文件夹。这样，一天就是一个文件夹的页面内容，查看管理也就显得比较合理。<BR><BR>ii，我在试图通过以上方法建立文件夹的时候，又发现了第二个问题。第一次通过FSO建立以当前日期命名的文件夹，没有问题。当我有新的文件需要生成时，因为是同一个程序，所以，其又将会执行建立同样的文件夹。此时，FSO组件会发现该路径已存在……卡壳-_-!&nbsp;继续处理，在首行添加代码：<BR><BR><BR>引用:&nbsp;<BR>--------------------------------------------------------------------------------<BR><BR>On&nbsp;Error&nbsp;Resume&nbsp;Next<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>嘿嘿，达到自欺欺人、掩耳盗铃的效果。<BR><BR>当然规矩的用法是判断文件夹的有无<BR><BR>引用:&nbsp;<BR>--------------------------------------------------------------------------------<BR><BR>&lt;%<BR>Set&nbsp;fso&nbsp;=&nbsp;Server.CreateObject("Scripting.FileSystemObject")<BR>if&nbsp;(fso.FolderExists(Server.MapPath(folder)))&nbsp;then<BR>'判断如果存在就不做处理<BR>else<BR>'判断如果不存在则建立新文件夹<BR>fso.CreateFolder(Server.MapPath(folder))<BR>end&nbsp;if<BR>%&gt;&nbsp;<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>iii，文件夹是建立了，文件该如何建立呢？主要也就是文件名的生成。当然这个就需要自己来写个函数，功能就是如何生成文件名：）<BR><BR>引用:&nbsp;<BR>--------------------------------------------------------------------------------<BR><BR>&lt;%<BR>function&nbsp;makefilename(fname)<BR>fname&nbsp;=&nbsp;fname&nbsp;'前fname为变量，后fname为函数参数引用<BR>fname&nbsp;=&nbsp;replace(fname,"-","")<BR>fname&nbsp;=&nbsp;replace(fname,"&nbsp;","")&nbsp;<BR>fname&nbsp;=&nbsp;replace(fname,":","")<BR>fname&nbsp;=&nbsp;replace(fname,"PM","")<BR>fname&nbsp;=&nbsp;replace(fname,"AM","")<BR>fname&nbsp;=&nbsp;replace(fname,"上午","")<BR>fname&nbsp;=&nbsp;replace(fname,"下午","")<BR>makefilename&nbsp;=&nbsp;fname&nbsp;&amp;&nbsp;".html"<BR>end&nbsp;function&nbsp;<BR>%&gt;<BR><BR>引用函数则：<BR>&lt;%fname&nbsp;=&nbsp;makefilename(now())%&gt;<BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>其实嘛，就是以年月日时分秒命名的文件。<BR><BR>iv，最后，生成的文件该如何查看到？当然需要把生成文件的路径保存的数据库中，并且添加到相对应的记录集中了。当然，这在下面的数据库设计时会提及到。<BR><BR>3，模板技术和2HTML技术的结合：将模板中特殊代码的值替换为从表单接受过来的值，完成模板功能；将最终替换过的所有模板代码生成HTML文件。需要注意的是：替换应能将输入数据的格式或者支持UBB的代码彻底改变。<BR><BR><BR>二，再进行数据库设计<BR><BR>目前数据库的设计需要两个表：一个是存放模板数据的；一个是存放信息内容的。<BR><BR>1，建立新数据库asp2html.mdb<BR><BR>2，设计新数据库表c_moban<BR>字段m_id（自动编号，主关键字）；字段m_html（备注类型）。<BR>并将下列完整的代码拷贝至m_html字段<BR><BR>引用:&nbsp;<BR>--------------------------------------------------------------------------------<BR><BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;meta&nbsp;http-equiv="Content-Type"&nbsp;content="text/html;&nbsp;charset=hz"&gt;<BR>&lt;title&gt;Cnbruce.Com&nbsp;|&nbsp;ASP2HTML&nbsp;TEST&lt;/title&gt;<BR>&lt;/head&gt;<BR>&lt;body&nbsp;leftmargin="0"&nbsp;topmargin="0"&gt;<BR>&lt;table&nbsp;width="100%"&nbsp;height="100%"&nbsp;border="0"&nbsp;cellpadding="5"&nbsp;cellspacing="2"&gt;<BR>&lt;tr&nbsp;align="right"&nbsp;bgcolor="#CCCCCC"&gt;&nbsp;<BR>&lt;td&nbsp;height="20"&nbsp;colspan="2"&gt;$cntop{LogContent}lt;/td&gt;<BR>&lt;/tr&gt;<BR>&lt;tr&nbsp;valign="top"&gt;&nbsp;<BR>&lt;td&nbsp;width="25%"&nbsp;bgcolor="#e5e5e5"&gt;$cnleft{LogContent}lt;/td&gt;<BR>&lt;td&nbsp;width="74%"&nbsp;bgcolor="#f3f3f3"&gt;$cnright{LogContent}lt;/td&gt;<BR>&lt;/tr&gt;<BR>&lt;/table&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt;<BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>3，设计新数据库表c_news<BR><BR>字段c_id：自动编号，主关键字<BR>字段c_title：文本类型，保存文章标题<BR>字段c_content：备注类型，保存文章内容<BR>字段c_filepath：文本类型，保持生成文件的路径地址<BR>字段c_time：日期/时间类型，默认值：Now()<BR><BR><BR>三，页面需求设计<BR><BR>1，首先建立一个存放HTML页的文件夹<BR><BR>在文件同一目录下，建立文件夹newsfile，夹子内部主要存放生成的HTML页面，当然内部还会采用程序方式建立以日期命名的子文件夹，以方便浏览以及管理。<BR><BR>2，功能函数页面lib.asp<BR><BR>引用:&nbsp;<BR>--------------------------------------------------------------------------------<BR><BR>&lt;%<BR>'生成文件名的函数<BR>function&nbsp;makefilename(fname)<BR>fname&nbsp;=&nbsp;fname<BR>fname&nbsp;=&nbsp;replace(fname,"-","")<BR>fname&nbsp;=&nbsp;replace(fname,"&nbsp;","")&nbsp;<BR>fname&nbsp;=&nbsp;replace(fname,":","")<BR>fname&nbsp;=&nbsp;replace(fname,"PM","")<BR>fname&nbsp;=&nbsp;replace(fname,"AM","")<BR>fname&nbsp;=&nbsp;replace(fname,"上午","")<BR>fname&nbsp;=&nbsp;replace(fname,"下午","")<BR>makefilename=fname&nbsp;&amp;&nbsp;".shtml"<BR>end&nbsp;function&nbsp;<BR><BR>'保持数据格式不变的函数<BR>function&nbsp;HTMLEncode(fString)<BR>fString&nbsp;=&nbsp;replace(fString,&nbsp;"&gt;",&nbsp;"&amp;gt;")<BR>fString&nbsp;=&nbsp;replace(fString,&nbsp;"&lt;",&nbsp;"&amp;lt;")<BR>fString&nbsp;=&nbsp;Replace(fString,&nbsp;CHR(32),&nbsp;"&amp;nbsp;")<BR>fString&nbsp;=&nbsp;Replace(fString,&nbsp;CHR(13),&nbsp;"")<BR>fString&nbsp;=&nbsp;Replace(fString,&nbsp;CHR(10)&nbsp;&amp;&nbsp;CHR(10),&nbsp;"&lt;br&gt;")<BR>fString&nbsp;=&nbsp;Replace(fString,&nbsp;CHR(10),&nbsp;"&lt;br&gt;")<BR>HTMLEncode&nbsp;=&nbsp;fString<BR>end&nbsp;function<BR>%&gt;<BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>3，数据库连接页面conn.asp<BR>完成数据库的字符串连接方法<BR>&lt;%<BR>set&nbsp;conn&nbsp;=&nbsp;Server.CreateObject("ADODB.Connection")<BR>connstr&nbsp;=&nbsp;"Provider=Microsoft.Jet.OLEDB.4.0;Data&nbsp;Source="&amp;Server.MapPath("asp2html.mdb")<BR>conn.Open&nbsp;connstr<BR>%&gt;<BR>4，信息输入页面add.html<BR>其实很简单：）就是表单嘛。注意action是跳转到addit.asp<BR><BR>引用:&nbsp;<BR>--------------------------------------------------------------------------------<BR><BR>&lt;form&nbsp;action="addit.asp"&nbsp;method="post"&gt;<BR>Title:&lt;input&nbsp;type="text"&nbsp;name="c_title"&gt;&lt;br&gt;<BR>Content:&lt;br&gt;<BR>&lt;textarea&nbsp;name="c_content"&nbsp;rows="8"&nbsp;cols="30"&gt;&lt;/textarea&gt;&lt;br&gt;<BR>&lt;input&nbsp;type="submit"&nbsp;value="/Add"&gt;<BR>&lt;input&nbsp;type="reset"&nbsp;value="Reset"&gt;<BR>&lt;/form&gt;<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>5，处理数据功能显示页面addit.asp<BR>首先是处理接受过来的数据，并将值写入数据库；接着将模板代码进行引用，并将其中特殊代码转换为接受值，最终通过FSO生成HTML页面。其中需要注意的还有，生成文件的路径地址保存至数据库表。<BR><BR>引用:&nbsp;<BR>--------------------------------------------------------------------------------<BR><BR>&lt;%"容错处理<BR>On&nbsp;Error&nbsp;Resume&nbsp;Next<BR>%&gt;<BR><BR>&lt;!--＃i nclude&nbsp;file="conn.asp"&nbsp;--&gt;<BR>&lt;!--＃i nclude&nbsp;file="lib.asp"&nbsp;--&gt;<BR><BR>&lt;%'接受传递值<BR>c_title=request.form("c_title")<BR>c_content=request.form("c_content")<BR>%&gt;<BR><BR>&lt;%'生成HTML文件名，建立文件夹，指定文件路径<BR>fname&nbsp;=&nbsp;makefilename(now())&nbsp;'makefilename为自定义函数&nbsp;<BR>folder&nbsp;=&nbsp;"newsfile/"&amp;date()&amp;"/"<BR>filepath&nbsp;=&nbsp;folder&amp;fname<BR>%&gt;<BR><BR>&lt;%'将接受值及路径保持至数据库表<BR>sql&nbsp;=&nbsp;"Select&nbsp;*&nbsp;from&nbsp;c_news"<BR>Set&nbsp;rs&nbsp;=&nbsp;Server.CreateObject&nbsp;("ADODB.Recordset")<BR>rs.Open&nbsp;sql,conn,3,2<BR>rs.addnew<BR>rs("c_title")=c_title<BR>rs("c_content")=c_content<BR>rs("c_filepath")=filepath<BR>rs.update<BR>rs.close&nbsp;<BR>Set&nbsp;rs&nbsp;=&nbsp;Nothing<BR>%&gt;<BR><BR>&lt;%'打开模板代码，并将其中特殊代码转变为接受值<BR>sql1="select&nbsp;m_id,m_html&nbsp;from&nbsp;c_moban&nbsp;where&nbsp;m_id=1"<BR>set&nbsp;rs1=Server.CreateObject("adodb.recordset")<BR>rs1.open&nbsp;sql1,conn,1,1<BR>mb_code=rs1("m_html")<BR>rs1.close<BR>set&nbsp;rs1=nothing<BR>conn.close<BR>set&nbsp;conn=nothing<BR>c_title=htmlencode(c_title)<BR>c_content=htmlencode(c_content)<BR>mb_code=replace(mb_code,"$cntop{LogContent}quot;,now())<BR>mb_code=replace(mb_code,"$cnleft{LogContent}quot;,c_title)<BR>mb_code=replace(mb_code,"$cnright{LogContent}quot;,c_content)<BR>%&gt;<BR><BR>&lt;%'生成HTML页面<BR>Set&nbsp;fso&nbsp;=&nbsp;Server.CreateObject("Scripting.FileSystemObject")<BR>fso.CreateFolder(Server.MapPath(folder))<BR>Set&nbsp;fout&nbsp;=&nbsp;fso.CreateTextFile(Server.MapPath(filepath))<BR>fout.WriteLine&nbsp;mb_code<BR>fout.close<BR>%&gt;<BR><BR>文章添加成功，&lt;a&nbsp;href="/showit.asp"&gt;浏览&lt;/a&gt;&nbsp;<BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>6，显示数据库表记录，并做指向HTML页的链接：showit.asp<BR><BR>引用:&nbsp;<BR>--------------------------------------------------------------------------------<BR><BR>&lt;!--＃i nclude&nbsp;file="conn.asp"&nbsp;--&gt;<BR>&lt;!--＃i nclude&nbsp;file="lib.asp"&nbsp;--&gt;<BR>&lt;%<BR>Set&nbsp;rs&nbsp;=&nbsp;Server.CreateObject&nbsp;("ADODB.Recordset")<BR>sql&nbsp;=&nbsp;"Select&nbsp;*&nbsp;from&nbsp;c_news&nbsp;order&nbsp;by&nbsp;c_id&nbsp;desc"<BR>rs.Open&nbsp;sql,conn,1,1<BR>%&gt;<BR><BR>&lt;%<BR>if&nbsp;rs.EOF&nbsp;and&nbsp;rs.BOF&nbsp;then<BR>response.write&nbsp;("暂时还没有文章，&lt;a&nbsp;href="/add.html&gt;";添加&lt;/a&gt;")<BR>else<BR>Do&nbsp;Until&nbsp;rs.EOF<BR>%&gt;<BR>&lt;table&nbsp;width="758"&nbsp;border="0"&nbsp;align="center"&nbsp;cellpadding="3"&nbsp;cellspacing="1"&nbsp;bgcolor="#000000"&gt;<BR>&lt;tr&gt;&nbsp;<BR>&lt;td&nbsp;width="159"&nbsp;align="right"&nbsp;bordercolor="#CCCCCC"&nbsp;bgcolor="#CCCCCC"&gt;&lt;%=rs("c_time")%&gt;&lt;/td&gt;<BR>&lt;td&nbsp;width="591"&nbsp;bordercolor="#f3f3f3"&nbsp;bgcolor="#f3f3f3"&gt;&lt;a&nbsp;href="/&lt;";%=rs("c_filepath")%&gt;&nbsp;target="a_blank"&gt;&lt;%=rs("c_title")%&gt;&lt;/a&gt;&lt;/td&gt;<BR>&lt;/tr&gt;<BR>&lt;tr&gt;&nbsp;<BR>&lt;td&nbsp;valign="top"&nbsp;align="right"&nbsp;bordercolor="#ececec"&nbsp;bgcolor="#ececec"&gt;[&lt;a&nbsp;href="/del.asp?c_id=&lt;";%=rs("c_id")%&gt;&gt;Dell&lt;/a&gt;][&lt;a&nbsp;href="/change.asp?c_id=&lt;";%=rs("c_id")%&gt;&gt;Edit&lt;/a&gt;][&lt;a&nbsp;href="/add.html"&gt;Add&lt;/a&gt;]&lt;/td&gt;<BR>&lt;td&nbsp;valign="top"&nbsp;bordercolor="#FFFFFF"&nbsp;bgcolor="#FFFFFF"&gt;&lt;%=htmlencode(rs("c_content"))%&gt;&lt;/td&gt;<BR>&lt;/tr&gt;<BR>&lt;/table&gt;&lt;br&gt;<BR>&lt;%<BR>rs.MoveNext<BR>Loop<BR>end&nbsp;if<BR>%&gt;<BR><BR>&lt;%<BR>rs.close&nbsp;<BR>Set&nbsp;rs&nbsp;=&nbsp;Nothing<BR>conn.close&nbsp;<BR>set&nbsp;conn=Nothing<BR>%&gt;<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>7，修改数据内容页change.asp<BR><BR>修改数据内容，同时也需要修改更新对应的HTML页面。修改其实就是重新生成文件，且文件名和之前一样，类似文件的覆盖。<BR><BR>引用:&nbsp;<BR>--------------------------------------------------------------------------------<BR><BR>&lt;!--＃i nclude&nbsp;file="conn.asp"&nbsp;--&gt;<BR>&lt;!--＃i nclude&nbsp;file="lib.asp"&nbsp;--&gt;<BR><BR>&lt;%id=request.querystring("c_id")%&gt;<BR><BR>&lt;%<BR>if&nbsp;request.form("submit")="change"&nbsp;then<BR>c_title=request.form("c_title")<BR>c_content=request.form("c_content")<BR>c_id=request.form("c_id")<BR>c_filepath=request.form("c_filepath")<BR><BR>Set&nbsp;rs&nbsp;=&nbsp;Server.CreateObject&nbsp;("ADODB.Recordset")<BR>sql&nbsp;=&nbsp;"Select&nbsp;*&nbsp;from&nbsp;c_news&nbsp;where&nbsp;c_id="&amp;c_id<BR>rs.Open&nbsp;sql,conn,3,2<BR>rs("c_title")=c_title<BR>rs("c_content")=c_content<BR>rs("c_time")=now()<BR>rs.update<BR>rs.close&nbsp;<BR>Set&nbsp;rs&nbsp;=&nbsp;Nothing<BR>%&gt;<BR><BR>&lt;%'打开模板代码，并将其中特殊代码转变为接受值<BR>sql1="select&nbsp;m_id,m_html&nbsp;from&nbsp;c_moban&nbsp;where&nbsp;m_id=1"<BR>set&nbsp;rs1=Server.CreateObject("adodb.recordset")<BR>rs1.open&nbsp;sql1,conn,1,1<BR>mb_code=rs1("m_html")<BR>rs1.close<BR>set&nbsp;rs1=nothing<BR>conn.close<BR>set&nbsp;conn=nothing<BR>c_title=htmlencode(c_title)<BR>c_content=htmlencode(c_content)<BR>mb_code=replace(mb_code,"$cntop{LogContent}quot;,now())<BR>mb_code=replace(mb_code,"$cnleft{LogContent}quot;,c_title)<BR>mb_code=replace(mb_code,"$cnright{LogContent}quot;,c_content)<BR>%&gt;<BR><BR>&lt;%'生成HTML页面<BR>Set&nbsp;fso&nbsp;=&nbsp;Server.CreateObject("Scripting.FileSystemObject")<BR>Set&nbsp;fout&nbsp;=&nbsp;fso.CreateTextFile(Server.MapPath(c_filepath))<BR>fout.WriteLine&nbsp;mb_code<BR>fout.close<BR>%&gt;<BR>&lt;%response.redirect("showit.asp")%&gt;<BR>&lt;%end&nbsp;if%&gt;<BR><BR>&lt;%<BR>if&nbsp;id&lt;&gt;""&nbsp;then<BR>Set&nbsp;rs&nbsp;=&nbsp;Server.CreateObject&nbsp;("ADODB.Recordset")<BR>sql="select&nbsp;*&nbsp;from&nbsp;c_news&nbsp;where&nbsp;c_id="&amp;id<BR>rs.Open&nbsp;sql,conn,1,1<BR>c_id=rs("c_id")<BR>c_filepath=rs("c_filepath")<BR>c_title=rs("c_title")<BR>c_content=rs("c_content")<BR>end&nbsp;if<BR>%&gt;<BR><BR>&lt;form&nbsp;action="change.asp"&nbsp;method="post"&gt;<BR>Title:&lt;input&nbsp;type="text"&nbsp;name="c_title"&nbsp;value="/&lt;%=c_title%&gt;&gt;&lt;br&gt;<BR>Content:&lt;br&gt;<BR>&lt;textarea&nbsp;name="c_content"&nbsp;rows="8"&nbsp;cols="30"&gt;&lt;%=c_content%&gt;&lt;/textarea&gt;&lt;br&gt;<BR>&lt;input&nbsp;type="submit"&nbsp;value="/change"&nbsp;name="submit"&gt;<BR>&lt;input&nbsp;type="reset"&nbsp;value="Reset"&gt;<BR>&lt;input&nbsp;name="c_id"&nbsp;type="hidden"&nbsp;value="&lt;%=id%&gt;"&gt;<BR>&lt;input&nbsp;name="c_filepath"&nbsp;type="hidden"&nbsp;value="&lt;%=c_filepath%&gt;"&gt;<BR>&lt;/form&gt;<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>8，删除记录页del.asp<BR><BR>同样！删除，除了删除数据库表中的记录，与其对应的HTML页面也需删除。代码如下：<BR><BR>引用:&nbsp;<BR>--------------------------------------------------------------------------------<BR><BR>&lt;!--＃i" nclude&nbsp;file="conn.asp"&nbsp;--&gt;<BR><BR>&lt;%<BR>c_id&nbsp;=&nbsp;request.querystring("c_id")<BR>sql&nbsp;=&nbsp;"Select&nbsp;*&nbsp;from&nbsp;c_news&nbsp;where&nbsp;c_id="&amp;c_id<BR>Set&nbsp;rs&nbsp;=&nbsp;Server.CreateObject&nbsp;("ADODB.Recordset")<BR>rs.Open&nbsp;sql,conn,2,3<BR><BR>filepath=rs("c_filepath")<BR>Set&nbsp;fso&nbsp;=&nbsp;CreateObject("Scripting.FileSystemObject")<BR>fso.DeleteFile(Server.mappath(filepath))<BR>Set&nbsp;fso&nbsp;=&nbsp;nothing<BR><BR>rs.delete<BR>rs.close&nbsp;<BR>Set&nbsp;rs&nbsp;=&nbsp;Nothing<BR>conn.close<BR>set&nbsp;conn=nothing<BR>%&gt;<BR><BR>&lt;%response.redirect("showit.asp")%&gt;<img src ="http://www.cnitblog.com/Jervis/aggbug/5119.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2005-12-04 12:50 <a href="http://www.cnitblog.com/Jervis/archive/2005/12/04/5119.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>有关站内模糊查询的源程序</title><link>http://www.cnitblog.com/Jervis/archive/2005/12/03/5112.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Sat, 03 Dec 2005 15:13:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2005/12/03/5112.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/5112.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2005/12/03/5112.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/5112.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/5112.html</trackback:ping><description><![CDATA[if bh="" then<BR>&nbsp;&nbsp;&nbsp;sql="select * from sl where bh like '%"&amp;ss&amp;"%'"<BR>&nbsp;&nbsp;else <BR>bh=clng(bh)<BR>sql="select * from sl where bh=" &amp; bh &amp; " "<BR>end if<BR>&nbsp;&nbsp;if nam&lt;&gt;"" then<BR>&nbsp;&nbsp;sql=sql&amp;" and nam like '%"&amp;nam&amp;"%' "<BR>&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;if jz&lt;&gt;"" then <BR>&nbsp;&nbsp;&nbsp;sql=sql&amp;" and jz like '%"&amp;jz&amp;"%' "<BR>end if<BR>if pc&lt;&gt;"" then<BR>pc=cint(pc)<BR>&nbsp;&nbsp;sql=sql&amp;" and pc="&amp;pc&amp;" "<BR>&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;if zw&lt;&gt;"" then<BR>&nbsp;&nbsp;sql=sql&amp;" and zw like '%"&amp;zw&amp;"%' "<BR>end if&nbsp;&nbsp;<img src ="http://www.cnitblog.com/Jervis/aggbug/5112.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2005-12-03 23:13 <a href="http://www.cnitblog.com/Jervis/archive/2005/12/03/5112.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>asp 读取 excel</title><link>http://www.cnitblog.com/Jervis/archive/2005/11/30/5037.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Wed, 30 Nov 2005 10:38:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2005/11/30/5037.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/5037.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2005/11/30/5037.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/5037.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/5037.html</trackback:ping><description><![CDATA[用ADO可以打开EXCEL文件<BR><BR>下面是个例子：<BR><BR>&lt;%<BR>'=====================ASP读取EXCEL注事项===========================<BR>'i)将Excel97或Excel2000生成的XLS文件（book）看成一个数据库，其中的每一个工作表(sheet)看成数据库表<BR>'ii)ADO假设Excel中的第一行为字段名.所以你定义的范围中必须要包括第一行的内容<BR>'iii)Excel中的行标题（即字段名）不能够包含数字. Excel的驱动在遇到这种问题时就会出错的。例如你的行标题名为“F1”<BR>'iiii)如果你的Excel电子表格中某一列同时包含了文本和数字的话,那么Excel的ODBC驱动将不能够正常, 处理这一行的数据类型，你必须要保证该列的数据类型一致<BR>'E-MAIL:Kaxue@Hotmail.com QQ:484110 HOMEPAGE:www.Flyday.net<BR>'整理时间：Thursday, May 23, 2002 5:54 PM WIN2000SERVER+IIS5 测式通过<BR>'===================================================================<BR><BR>Dim Conn,Driver,DBPath,Rs<BR>' 建立Connection对象<BR>Set Conn = Server.CreateObject("ADODB.Connection"<IMG src="http://www.blueidea.com/bbs/images/wink.gif"><BR>Driver = "Driver={Microsoft Excel Driver (*.xls)};"<BR>DBPath = "DBQ=" &amp; Server.MapPath( "test.xls" )<BR>'调用Open 方法打开数据库<BR>Conn.Open Driver &amp; DBPath<BR><BR>'DSN连接方式<BR>'Conn.Open "Dsn=test"<BR>'注意 表名一定要以下边这种格试 "[表名$]" 书写<BR>Sql="Select * From [Sheet1$] where 序号=0"<BR>Set Rs=Conn.Execute(Sql)<BR><BR>IF Rs.Eof And Rs.Bof Then<BR>Response.write "没有找到您需要的数据!!"<BR>Else<BR><BR>Do While Not Rs.EOF<BR><BR>Response.write Rs("姓名")<BR><BR>Rs.MoveNext<BR>Loop<BR>End IF<BR><BR>Rs.Close<BR>Set Rs=nothing<BR>Conn.Close<BR>Set Conn=Nothing<BR>'Response.Write "成功！"<BR>%&gt;<BR><img src ="http://www.cnitblog.com/Jervis/aggbug/5037.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2005-11-30 18:38 <a href="http://www.cnitblog.com/Jervis/archive/2005/11/30/5037.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>作品</title><link>http://www.cnitblog.com/Jervis/archive/2005/11/21/4773.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Mon, 21 Nov 2005 08:49:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2005/11/21/4773.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/4773.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2005/11/21/4773.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/4773.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/4773.html</trackback:ping><description><![CDATA[刚帮朋友做得网站<BR><A href="http://www.shangxu-sh.com">http://www.shangxu-sh.com</A><BR>大家看看给点意见<BR><img src ="http://www.cnitblog.com/Jervis/aggbug/4773.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2005-11-21 16:49 <a href="http://www.cnitblog.com/Jervis/archive/2005/11/21/4773.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Director的xtra资源列表(2)</title><link>http://www.cnitblog.com/Jervis/archive/2005/11/21/4772.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Mon, 21 Nov 2005 08:11:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2005/11/21/4772.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/4772.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2005/11/21/4772.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/4772.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/4772.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: MBSAPI描述：MBSAPI Xtra 提供一些和Windows操作系统相关的API函数(1.0收录61条指令)。适用于Director 8.0以上版本。初始版本 1.0作者：宋博www.mobiusclub.com&nbsp;FreePPP Control 描述：控制与因特网的连接。 开发商：Paul Farry http://www.magna.com.au/...&nbsp;&nbsp;<a href='http://www.cnitblog.com/Jervis/archive/2005/11/21/4772.html'>阅读全文</a><img src ="http://www.cnitblog.com/Jervis/aggbug/4772.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2005-11-21 16:11 <a href="http://www.cnitblog.com/Jervis/archive/2005/11/21/4772.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Director的xtra资源列表(1)</title><link>http://www.cnitblog.com/Jervis/archive/2005/11/21/4771.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Mon, 21 Nov 2005 08:10:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2005/11/21/4771.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/4771.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2005/11/21/4771.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/4771.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/4771.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Director的xtra按照功能可以分为很多种，例如，创作类，在编辑状态下使用，数据库类，文件类，操作系统类，声音类等。本附录会给出每个插件的简单功能描述，相信可以极大的扩展大家的Director程序和演示的功能。&nbsp;3DE7描述：100% 编写的用于D7 Shockwave的3D引擎。可以通过常见的模型模式生成多边形的3D几何体。开发商：Dave's 3D Engine...&nbsp;&nbsp;<a href='http://www.cnitblog.com/Jervis/archive/2005/11/21/4771.html'>阅读全文</a><img src ="http://www.cnitblog.com/Jervis/aggbug/4771.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2005-11-21 16:10 <a href="http://www.cnitblog.com/Jervis/archive/2005/11/21/4771.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>光盘解决数据库方案</title><link>http://www.cnitblog.com/Jervis/archive/2005/11/21/4769.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Mon, 21 Nov 2005 07:39:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2005/11/21/4769.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/4769.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2005/11/21/4769.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/4769.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/4769.html</trackback:ping><description><![CDATA[数据库是大量有序数据的集合，在网站建设中被大量使用，同时也用在多媒体软件中，但是常用的多媒体创作软件Authweaver和Director都没有直接提供数据库支持，需要第三方插件才能完成数据库的存取，非常不方便；在Asp网页中使用数据库十分容易，于是是否可以在不需要服务器支持的情况下，在本地网页中使用数据库呢，答案是可以的，笔者在多媒体软件开发中，通过调用网页，完成数据库的访问，达到了很好的效果，总结了一些经验，希望对你在多媒体软件中使用数据库有所帮助。<BR>这里我们以Access数据库说明，类似的只要支持ODBC、SQL的数据库系统都可以使用类似的方法在本地网页中使用数据库。<BR>1． ADO基础<BR>ADO对象即Active Data Objects，是ASP网页访问数据库的基础，它包含三种对象：Connection、Recordset和Command，其中Connection用来连接数据库，Recordset记录集用来存取记录，Command用来执行SQL命令。同时你的计算机必须安装相应的ODBC驱动后才可以使用ADO对象访问相应的数据库。<BR><BR><BR>2． Asp中怎么访问数据库<BR>一般在使用ADO对象访问数据库的时候，先建立Connection连接，再生成Recordset对象存取数据。下面是Asp网页访问数据库的代码：<BR>set conn = server.createobject("ADODB.Connection")<BR>‘建立Connection对象<BR>conn.open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=d:\example.mdb;"<BR>‘打开数据库连接<BR>sql = " SELECT * FROM spheres "<BR>‘SQL查询语句<BR>set rs = conn.execute(sql)<BR>‘执行Sql查询语句，并返回记录集到rs，这个时候就可以按rs(“字段名”)来访问查询结果中指定字段的值了<BR><BR><BR>另一种用法先建立记录集对象，如下<BR>str_conn= "DBQ=F:\ example.mdb;Driver={Microsoft Access Driver (*.mdb)};"<BR>‘连接字符串<BR><BR>set rs = Server.CreateObject("ADODB.Recordset")<BR>‘建立记录集对象<BR>rs.ActiveConnection = str_conn<BR>‘打开数据库连接<BR>rs.Source = "SELECT * FROM spheres"<BR>‘SQL查询语句<BR>rs.CursorType = 0<BR>‘游标类型<BR>rs.CursorLocation = 2<BR>‘游标位置<BR>rs.LockType = 3<BR>锁定类型<BR>rs.Open()<BR>‘打开记录集，并返回给rs<BR><BR>对于语句Del、Update、Insert into，是不返回数据的，可以使用conn.execute sql即可<BR><BR><BR>下面的代码完整的说明了，Asp如何使用ADO对象访问数据库并将记录集对象id的值循环显示在网页上的，示例数据库为example.mdb，包括一个有三个字段id、color、radius的表spheres，代码如下：<BR>&lt;%<BR>str_conn= "DBQ=G:\htmlsearch\example.mdb;Driver={Microsoft Access Driver (*.mdb)};"<BR>Set conn = server.CreateObject("ADODB.Connection") <BR>conn.Open str_conn <BR>sql= "SELECT * FROM spheres" <BR>Set rs = conn.Execute( sql )<BR><BR><BR>‘循环显示所有记录<BR>While (NOT rs.EOF) <BR>response.write "id=" &amp; rs("id").Value &amp; "&lt;br&gt;"<BR>rs.MoveNext()<BR>Wend<BR><BR><BR>rs.Close()<BR>conn.Close()<BR>'关闭对象，必须的<BR>%&gt;<BR>参见: asp_all.asp<BR><BR><BR><BR>3． 在本地网页中访问数据库<BR>将上面的代码保存为文件html_all.htm，看看还能不能访问数据库，注意把标记&lt;% %&gt;修改为&lt;script&gt; &lt;/script&gt;，代码如下：<BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;title&gt;本地数据库访问&lt;/title&gt;<BR>&lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312"&gt;<BR>&lt;script language=vbscript&gt;<BR>str_conn= "DBQ=G:\htmlsearch\example.mdb;Driver={Microsoft Access Driver (*.mdb)};"<BR>Set conn = server.CreateObject("ADODB.Connection") <BR>conn.Open str_conn <BR>sql= "SELECT * FROM spheres" <BR>Set rs = conn.Execute( sql )<BR><BR><BR>‘循环显示所有记录<BR>While (NOT rs.EOF) <BR>response.write "id=" &amp; rs("id").Value &amp; "&lt;br&gt;"<BR>rs.MoveNext()<BR>Wend<BR><BR><BR>set rs=nothing<BR>conn.close<BR>'关闭对象，必须的<BR>&lt;/script&gt;<BR>&lt;/head&gt;<BR>&lt;body&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt;<BR>参见：html_all_1.htm<BR><BR>执行后页面什么也没有显示，也没有提示，问题在哪里呢？<BR>我们注意到这里的两个Asp服务器对象：server和response，可是现在我们没有服务器，网页只是在浏览器端执行的，所以我们试着把sever去掉，response对象用document对象代替，因为asp中response的主要作用也是向浏览器输出内容，改变后的代码如下：<BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;title&gt;本地数据库访问&lt;/title&gt;<BR>&lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312"&gt;<BR>&lt;script language=vbscript&gt;<BR><BR><BR>str_conn= "DBQ=G:\htmlsearch\example.mdb;Driver={Microsoft Access Driver (*.mdb)};"<BR>Set conn = CreateObject("ADODB.Connection") <BR>conn.Open str_conn <BR>sql= "SELECT * FROM spheres" <BR>Set rs = conn.Execute( sql ) <BR><BR><BR>While (NOT rs.EOF) <BR>document.write "id=" &amp; rs("id").Value &amp; "&lt;br&gt;"<BR>rs.MoveNext()<BR>Wend<BR><BR><BR>set rs=nothing<BR>conn.close<BR>&lt;/script&gt;<BR>&lt;/head&gt;<BR>&lt;body&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt;<BR>参见：html_all.htm<BR>运行该网页，正如你所看见的，数据库的内容被输出到浏览器了，和Asp执行后的结果一样，说明本地访问数据库是可以的。<BR><BR>4． ‘注意只读属性<BR>在实际的多媒体光盘应用中，注意设置游标、锁定类型，特别是在多媒体光盘中使用的时候，一定要设置为只读数据类型，同时不要使用Del、Update、Insert into等Sql语句，以免发生错误，类似的如下：<BR>这里调用记录集对象的Open方法创建记录集<BR><BR>rs.open Sql语句,conn,1,1 <BR>第一个参数为要执行的Sql语句<BR><BR>第二个参数为已经创建的connection连接对象<BR><BR>最后两个参数比较重要，第三个参数是记录集类型，可以包括<BR><BR>0， 只读且只能向下移动<BR><BR>3， 只读可自由移动<BR><BR>1，可读写可自由移动<BR><BR>2，可读写可自由移动，但新增数据共享<BR><BR><BR><BR>第四个参数是锁定类型，包括<BR><BR>1，默认值，只读<BR><BR>2，悲观锁定<BR><BR>3，乐观锁定<BR><BR>4，次乐观锁定<BR><BR><BR><BR>5． 数据传递<BR>asp对象已经不可能在这里使用了，在本地网页中使用数据库最麻烦的是数据传递，当提交一个查询的时候，查询的数据如何传递到下一个页面，这里我给出自己的做法：<BR>a) 代替Server.mappath<BR>Server.mappath（）用来获取指定文件的磁盘路径，这里我们可以用一个Vb函数代替，代码如下：<BR>Founction mappath(x)<BR>spath=document.location.pathname<BR>spath=mid(spath,2, instrrev(spath,"\")-1)<BR>mappath=spath &amp; “\” &amp; x<BR>end founction<BR><BR>b) request<BR>c) 其他解决办法<BR>6． 应用,结束<BR><img src ="http://www.cnitblog.com/Jervis/aggbug/4769.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2005-11-21 15:39 <a href="http://www.cnitblog.com/Jervis/archive/2005/11/21/4769.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>相册</title><link>http://www.cnitblog.com/Jervis/archive/2005/10/31/3724.html</link><dc:creator>甘盛浩</dc:creator><author>甘盛浩</author><pubDate>Mon, 31 Oct 2005 03:18:00 GMT</pubDate><guid>http://www.cnitblog.com/Jervis/archive/2005/10/31/3724.html</guid><wfw:comment>http://www.cnitblog.com/Jervis/comments/3724.html</wfw:comment><comments>http://www.cnitblog.com/Jervis/archive/2005/10/31/3724.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Jervis/comments/commentRss/3724.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Jervis/services/trackbacks/3724.html</trackback:ping><description><![CDATA[<A href="http://www.wersling.com/practise/imagebox/">http://www.wersling.com/practise/imagebox/</A><img src ="http://www.cnitblog.com/Jervis/aggbug/3724.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Jervis/" target="_blank">甘盛浩</a> 2005-10-31 11:18 <a href="http://www.cnitblog.com/Jervis/archive/2005/10/31/3724.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>