active部件不能创建对象错误怎么办

今天把某网站数据下载下本地,用绿色版ASP端口服务器,提示错误“active部件不能创建对象”,那应该是某个DLL没有注册,伤不起,还好,有高手碰到过此问题,分享了解决方案,于此也解决了这个问题,我也在小站上分享一下。
新建记事本文件,把下面的复制到记事本,然后另存为0535code.bat或者0535code.cmd然后双击就开始运行啦,下面代码是注册每一个DLL,查漏补缺,此问题到此为止,就是这样解决的。
regsvr32 scrrun.dll /s
regsvr32 scrrnchs.dll /s
regsvr32 vbscript.dll /s
regsvr32 jscript.dll /s
regsvr32 msscript.ocx /s
regsvr32 scriptpw.dll /s
regsvr32 scripto.dll /s
regsvr32 VBCHS.dll /s
regsvr32 mfc42.dll /s
regsvr32 mfc42loc.dll /s
regsvr32 msxml.dll /s
regsvr32 msxml2.dll /s
regsvr32 msxml3.dll /s
regsvr32 msxml4.dll /s
regsvr32 actxprxy.dll /s
regsvr32 dispex.dll /s
regsvr32 hhctrl.ocx /s
regsvr32 msdart.dll /s
regsvr32 mshtml.tlb /s
regsvr32 mswstr10.dll /s
regsvr32 netapi32.dll /s
regsvr32 odbc32.dll /s
regsvr32 odbcint.dll /s
regsvr32 oleacc.dll /s
regsvr32 oleaccrc.dll /s
regsvr32 stdole2.tlb /s
regsvr32 w03a2409.dll /s
regsvr32 iepeers.dll /s
regsvr32 c:\windows\system32\mui\0804\hhctrlui.dll /s
regsvr32 C:\Progra~1\Common~1\System\msadc\msadce.dll /s
regsvr32 C:\Progra~1\Common~1\System\msadc\msadcer.dll /s
regsvr32 C:\Progra~1\Common~1\System\ADO\msado15.dll /s
regsvr32 C:\Progra~1\Common~1\System\msadc\msdaprst.dll /s
regsvr32 C:\Progra~1\Common~1\System\OleDB~1\oledb32.dll /s
regsvr32 C:\Progra~1\Common~1\System\OleDB~1\oledb32r.dll /s
 

伪静态简单小例子

下面是一段简单的伪静态实现代码:

<%OPTION EXPLICIT%>
<%
'根据传值取得ID
Function getId()
getId = Request.ServerVariables("QUERY_STRING")
If getId = "" Then
getId = -1'-1表示没有按
Else
getId = Replace(getId,"/","")
getId = int(Replace(getId,".html",""))
End If
End Function
Dim id
id = int(Request.QueryString("id"))'除了伪静态可以打开,正常的asp也要可以打开
If id = 0 Then id = getId()
Response.Write(id)
%>
<a href="test.asp?/1.html" title="test.asp?/555.html">测试一下</a>

asp传参发邮件

呵呵,公司需要网站提交表单后发到邮箱里,ASP不是做不到,但是需要组件支持,于此同事用.NET给我写了一个接口,直接调用传参就可以发送了,下面分享一下代码。
其中str1到str0都是表单里面的文本框,静态页和表单的代码就不一一列出了。

<meta http-equiv = "Content-Type" content = "text/html; charset = utf-8" />
<%
dim conststr1,conststr2,conststr3,conststr4,conststr5,conststr6,conststr7,conststr8,conststr9,conststr0,url,strP
dim requeststr1,requeststr2,requeststr3,requeststr4,requeststr5,requeststr6,requeststr7,requeststr8,requeststr9,requeststr0
dim strcount
dim temp1,temp2,temp3,temp4,temp5,temp6,temp7,temp8,temp9,temp0
strP = "<p>"
temp1 = request.form("str1")
temp2 = request.form("str2")
temp3 = request.form("str3")
temp4 = request.form("str4")
temp5 = request.form("str5")
temp6 = request.form("str6")
temp7 = request.form("str7")
temp8 = request.form("str8")
temp9 = request.form("str9")
temp0 = request.form("str0")

conststr1 = "公司名称: "
requeststr1 = conststr1 & temp1 & strP
conststr2 = "项目名称: "
requeststr2 = conststr2 & temp2 & strP
conststr3 = "项目预算: "
requeststr3 = conststr3 & temp3 & strP
conststr4 = "联系人: "
requeststr4 = conststr4 & temp4 & strP
conststr5 = "E-Mail: "
requeststr5 = conststr5 & temp5 & strP
conststr6 = "手机: "
requeststr6 = conststr6 & temp6 & strP
conststr7 = "电话: "
requeststr7 = conststr7 & temp7 & strP
conststr8 = "QQ: "
requeststr8 = conststr8 & temp8 & strP
conststr9 = "地址: "
requeststr9 = conststr9 & temp9 & strP
conststr0 = "需求描述: "
requeststr0 = conststr0 & temp0 & strP
strcount = requeststr1 & requeststr2 & requeststr3 & requeststr4 & requeststr5 & requeststr6 & requeststr7 & requeststr8 & requeststr9 & requeststr0

response.write strcount

url = "http://www.tuanb2b.com/openInterface/SendMail.aspx?action=sendMail&sendMail=454690484@qq.com&sendContent="& strcount &"&returnUrl=http://www.0535code.com"
Response.Redirect(url)
%>

去掉老Y文章管理Powered by laoy8! V2.3

1.如果你不要这段:
在主文件夹下 inc.asp 里?去掉Call Label(2)?’统计代码
2.如果你还要这段话,只是想修改成你自己的话:在Inc文件夹下修改conn.asp文件的:Response.Write(” <li>P”&”o”&”w”&”e”&”r”&”e”&”d”&” b”&”y <b>”&”l”&”a”&”o”&”y”&”8″&”!”&” <a href=””ht”&”tp:”&”/”&”/”&”ww”&”w.”&”l”&”a”&”o”&”y”&”8″&”.c”&”n””? target=””_blank””>V”&”2″&”.”&”3</a><b></li>”&rsLabel(“Content”)&””)

XMLHTTP生成静态网页代码

XMLHTTP生成静态网页代码

url = "http://www.0535code.com/"
set http=Server.createobject("Msxml2.XMLHTTP")
Http.open "GET",url,false
Http.send()
set objStream = Server.CreateObject("ADODB.Stream")
objStream.type = 1
objStream.open
objstream.write http.responseBody
objstream.saveToFile server.mappath("index.html"),2
objstream.close
Response.Write "成功生成主页!<a href=index.html>浏览主页</a>"

ASP用户登录模块的设计

用户登录验证脚本,Chkpwd.asp

<%
'=======用户登录验证脚本=======
'如果尚未定义Passed对象,则将其定义为false,表示没有通过验证
If IsEmpty(Session("Passed")) Then
Session("Passed")=false
End If

'Session("Passed")=False,表示尚未通过验证,则开始读取从表单传来的验证信息
If Session("Passed")=False Then
UserName=Request.Form("UserName")
UserPwd=Request.Form("UserPwd")

If UserName="" Then
Errmsg="提示:请输入用户名和密码"
Else
'===================连接数据库=====================
Set Conn= Server.CreateObject("ADODB.Connection")
Conn.Connectionstring= "Driver={SQL Server};Server=192.168.1.3;UID=sa;PWD=;Database=zcmrs"
Conn.open
'===================从表log中读取用户数据=====================
'定义RecordSet对象
Set rs=Server.CreateObject("ADODB.Recordset")
'设置Connection对象的ConnectionString
Set rs.ActiveConnection=Conn
'设置游标类型
rs.CursorType=3
'打开记录集
rs.Open "Select username,password from erpuser Where username='"&UserName&"'"
'===================身份验证======================
If rs.EOF Then
Errmsg="提示:用户不存在或密码错误"
Else
If UserPwd<>rs.Fields("password") Then
Errmsg="提示:登录失败!密码错误?"
Else '登录成功
Errmsg=""
Session("Passed")=True
Session("UserName")=rs.Fields("username")
'标识用户权限 Session("UserID")=rs.Fields("UserID")
End If
End If
End If
End If
'经过登录不成功,则画出登录表单
If Not Session("Passed")=True Then
%>

下面是html静态页

<html>
<head><title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 12px;font-weight:bold;margin-left:120px;outline:double}
-->
</style>
<style type="text/css">
<!--
.STYLE2 {font-size: 12px;font-weight:bold;outline:double;color:#FF3333}
-->
</style>
</head>
<body leftmargin=0 topmargin=0 marginheight="0" marginwidth="0" bgcolor="#000000">
<div id=parent>
<div id=denglu style="font-weight: bold;"><br>ERP系统登录</div>
<form action="<%=request.ServerVariables("path_info")%>" method="post" name="MyForm" id="MyForm">
<p class="STYLE1">用户名:<input name="UserName" type="text" id="UserName" size="18" maxlength="20">
</p>
<p class="STYLE1">密 码:<input name="UserPwd" type="password" id="UserPwd" size="18" maxlength="20">
</p>
<p align="center" class="STYLE2"><%=Errmsg%> </p>
<p>
<input type="submit" align="middle" name="Submit" value="登录系统">
<input name="rege" type="button" align="middle" onClick="location='register.asp'" id="rege" value="注册用户">
</p>
</form>
</div>
</body>
</html>

要访问的页面erp.asp

<!--#include file="chkpwd.asp"-->
<body>
<div style='font-size:12px;font-weight:bold;border:1px solid #001;padding:4px;background:#FFCCFF;margin-top:0;'>欢迎使用ERP查询系统,当前登录用户为:
<%
If Session("Passed")=True Then
Response.Write(Session("UserName"))
End If
%><a href="logout.asp">退出系统</a>
</div>
</body>

以上每次打开erp.asp的时候,都首先执行Chkpwd.asp(),这样可以有效防止未授权用户访问指定网页.

logout.asp系统退出

<%
Session("Passed")=false
Session("UserName")=""
Response.Redirect("index.asp")
%>

使用图片提交表单

<form name="form1" method="post" action="">
<td align="right"><input type="image" method="submit" name="submit" src="image/loginin.gif" width="70" height="21" alt="submit"></td>
</form>