首页新闻找找看学习计划

请朋友帮看看下面代码系统提示红色部分语法问题,求解决!急!谢谢

0
悬赏园豆:5 [已关闭问题] 关闭于 2013-07-26 22:47

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/conn_ch_web.asp" -->
<html>
<head>
<title><%=Session("MM_username")%>邮件服务</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
A:link{COLOR:#000000; FONT-SIZE:14px; TEXT-DECORATION:underline none}
A:visited{COLOR:#000000; FONT-SIZE:14px; TEXT-DECORATION:underline none}
A:hover{COLOR:red; FONT-SIZE:14px; TEXT-DECORATION:underline}
</style>
<link rel="stylesheet" href="site_css.css" type="text/css">
<style type="text/css">
<!--
body {
margin-top: 40px;
}
-->
</style></head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="96%" border="1" align="center" cellpadding="0" cellspacing="0"
bordercolorlight="#000000" bordercolordark="#ffffff">
<tr>
<td bgcolor="#EBEEF3" class="dazi" height="26">
<div align="center">邮件操作成功消息</div>
</td>
</tr>
<tr>
<td class="zi">
<p><b><br>
操作成功:</b></p>
<p>发送邮件成功,发送的邮件放在你的发件箱里!<br>
</p>
</td>
</tr>
<tr>
<td bgcolor="#EBEEF3" height="24">
<div align="center"><a href="s_receive.asp">返回发件箱</a></div>
</td>
</tr>
</table>
<% if Request.Form("hid_accept_man")<>"" and Request.Form("txt_titlename")<>"" and
Request("txt_content")<>"" then


dim db
Set db=Server.CreateObject("ADODB.Connection")
db.open "provider=SQLOLEDB;server=localhost;database=hflcd;UID=hflcd_webuser;PWD=hflcd_webuser"
Dim strsql,vartxt1,vartxt2,vartxt3,vartxt4,m,n
if instr(1,Request.Form("hid_accept_man"),";")>0 then
for i=0 to len(Request.Form("hid_accept_man"))
m=i
m=instr(m+1,Request.Form("hid_accept_man"),";")
if m<>n and m<>0 then
vartxt1=Cstr(Mid(Request.Form("hid_accept_man"),n+1,m-n-1))
Dim Red1__m
Red1__m = "*"
if (vartxt1 <> "") then Red1__m = vartxt1
set Red1 = Server.CreateObject("ADODB.Recordset")
Red1.ActiveConnection = MM_conn_ch_web_STRING
Red1.Source = "SELECT user_name FROM dbo.user_login where user_name='" + Replace(Red1__m, "'",
"''") + "'"
Red1.CursorType = 0
Red1.CursorLocation = 2
Red1.LockType = 3
Red1.Open()
Red1_numRows = 0
if Red1.eof or Red1.bof then
Response.Redirect "s_sendfail.asp"
end if
Red1.close()
vartxt2=Request.Form("txt_titlename")
vartxt3=Request.Form("txt_content")
vartxt4=Session("MM_username")
vartxt5=Request.Form("hid_is_fj")
vartxt6=Request.Form("hid_fjpath")
strsql="insert into info(send_man,accept_man,titlename,content,is_fj,fj_path)"
values('"&vartxt4&"','"&vartxt1&"','"&vartxt2&"','"&vartxt3&"',"&vartxt5&",'"&vartxt6&"')
db.execute(strsql)
end if
n=m
next
Response.Redirect "s_sendok.asp"
else
vartxt1=Request.Form("hid_accept_man")
vartxt2=Request.Form("txt_titlename")
vartxt3=Request.Form("txt_content")
vartxt4=Session("MM_username")
vartxt5=Request.Form("hid_is_fj")
vartxt6=Request.Form("hid_fjpath")

Dim Red1__mm
Red1__mm = "*"
Red1__mm = vartxt1
set Red1 = Server.CreateObject("ADODB.Recordset")
Red1.ActiveConnection = MM_conn_ch_web_STRING
Red1.Source = "SELECT user_name FROM dbo.user_login where user_name='" + Replace(Red1__mm, "'",
"''") + "'"
Red1.CursorType = 0
Red1.CursorLocation = 2
Red1.LockType = 3
Red1.Open()
Red1_numRows = 0
if Red1.eof or Red1.bof then
Response.Redirect "s_sendfail.asp"
end if
Red1.close()
strsql="insert into info(send_man,accept_man,titlename,content,is_fj,fj_path)
values('"&vartxt4&"','"&vartxt1&"','"&vartxt2&"','"&vartxt3&"',"&vartxt5&",'"&vartxt6&"')"
db.execute(strsql)

 

Response.Redirect "s_sendok.asp"
end if

 

end if
%>
</body>
</html>

问题补充:

更改为'"&vartxt5&"'后,发送邮件提示:

Microsoft VBScript 编译器错误 错误 '800a0409'

未结束的字符串常量

/s_info/s_sendok.asp,行75

strsql="insert into info(send_man,accept_man,titlename,content,is_fj,fj_path)

 

389418045的主页 389418045 | 初学一级 | 园豆:199
提问于:2012-08-12 16:59
< >
分享
所有回答(3)
0

"&vartxt5&"少了'

'"&vartxt5&"'

Bce | 园豆:381 (菜鸟二级) | 2012-08-12 17:51
0

strsql="insert into info(send_man,accept_man,titlename,content,is_fj,fj_path)

这句代码和下一句代码是不是不在同一行啊,改成在同一行试试吧

I,Robot | 园豆:9461 (大侠五级) | 2012-08-13 17:23

试过了,不行。

支持(0) 反对(0) 389418045 | 园豆:199 (初学一级) | 2012-08-13 17:45
0

自己已经解决了,呵呵。谢谢大家的帮忙。很感谢你们。

389418045 | 园豆:199 (初学一级) | 2012-08-13 17:45
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册