读书人

asp异常 类型不匹配?

发布时间: 2012-03-21 13:33:14 作者: rapoo

asp错误 类型不匹配???
<%Server.ScriptTimeOut=5000%>
<!--#include FILE= "upload_5xsoft.inc "-->
<title> 化境编程界文件上传修改版 修改者:gztiger </title>
<%
dim upload,file,formName,formPath,iCount
set upload=new upload_5xsoft ' '建立上传对象

Text1=Trim(upload.form( "Text1 ")) '----获取表单文本框信息(原来代码用for循环)-目的为了说明获取文本框信息的方法
Text2=Trim(upload.form( "Text2 "))
Text3=Trim(upload.form( "Text3 "))
Text4=Trim(upload.form( "Text4 "))
Text5=Trim(upload.form( "Text5 "))
Text6=Trim(upload.form( "Text6 "))
Text7=Trim(upload.form( "Text7 "))
iCount=0
n=1
response.write " <br> "
for each formName in upload.objFile ' '------------------列出所有上传了的文件
set file=upload.file(formName) ' '--------------------生成一个文件对象
Image_countn=Image_countn& ", "&file.FileName '----------把图象名做成数组
if file.FileSize> 0 then ' '------------------------如果 FileSize > 0 说明有文件数据
file.SaveAs Server.mappath( "img/ "&file.FileName) ' '----------保存文件
end if
n=n+1
set file=nothing
next
set upload=nothing '------------------------------- '删除此对象
Image_Set=split(Image_countn, ", ") '---------------------返回数组

'------添加信息到数据库-------------------------------------
C+server.mappath( "img_text.mdb ")+ ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}; "
Set Conn=Server.createobject( "ADODB.Connection ")


Conn.Open Connstr
Set Rs=Server.CreateObject( "ADODB.RecordSet ")
sql= "selec * from imgdata "
Rs.Open sql,Conn,1,3
if not rs.eof then
id=Rs( "id ")+1
else
id=1
end if
Rs.Addnew
Rs( "Text1 ")=Text1
Rs( "Text2 ")=Text2
Rs( "Text3 ")=Text3
Rs( "Text4 ")=Text4
Rs( "Text5 ")=Text5
Rs( "Text6 ")=Text6
Rs( "Text7 ")=Text7
Rs( "imagedata1 ")=Image_Set(1)
Rs( "imagedata2 ")=Image_Set(2)
Rs( "imagedata3 ")=Image_Set(3)
Rs.Update
Rs.Close
Set Rs=Nothing
upload_ok=true
if upload_ok=true then
'-------回显提交信息---------------------------
response.Write( "您上传的信息如下: "& " <br> ")
C+server.mappath( "img_text.mdb ")+ ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}; "
Set Conn=Server.createobject( "ADODB.Connection ")
Conn.Open Connstr
Set Rs=Server.CreateObject( "ADODB.RecordSet ")
sql= "select * from imgdata order by id desc "
Rs.Open sql,Conn,1,1
%>
文本1: <%=Rs( "Text1 ")%> <br>
文本2: <%=Rs( "Text2 ")%> <br>
文本3: <%=Rs( "Text3 ")%> <br>
文本4: <%=Rs( "Text4 ")%> <br>
文本5: <%=Rs( "Text5 ")%> <br>
文本6: <%=Rs( "Text6 ")%> <br>
文本7: <%=Rs( "Text7 ")%> <br>
<%if Rs( "imagedata1 ") <> " " then%>


图象1: <%=Rs( "imagedata1 ")%> <br>
<img src= "img/ <%=Rs( "imagedata1 ")%> "> <br>
<%end if%>
<%if Rs( "imagedata2 ") <> " " then%>
图象2: <%=Rs( "imagedata2 ")%> <br>
<img src= "img/ <%=Rs( "imagedata2 ")%> " > <br>
<%end if%>
<%if Rs( "imagedata3 ") <> " " then%>
图象3: <%=Rs( "imagedata3 ")%> <br>
<img src= "img/ <%=Rs( "imagedata3 ")%> " > <br>
<% end if
Rs.Close
Set Rs=Nothing
end if
%>

错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: 'C '
请高手帮忙改下?谢谢!

[解决办法]
'------添加信息到数据库-------------------------------------
Connstr=server.mappath( "img_text.mdb ")+ ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}; "
Set Conn=Server.createobject( "ADODB.Connection ")
Conn.Open Connstr
[解决办法]
C+是什么啊,楼主
Connstr=server.mappath( "img_text.mdb ")+ ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}; "

读书人网 >ASP

热点推荐