[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'username=''l''' 中。
<%'读出姓名、部门、职位setconn=opendb("oabusy","conn","accessdsn")setrs=server.createobject("ad...
<%
'读出姓名、部门、职位
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select name,userdept,userlevel from userinf where username='" & sqlstr(username) & "'"
rs.cursorLocation = 3
rs.open sql,conn,1,1
If Not (rs.eof and rs.bof) then
name=rs("name")
userdept=rs("userdept")
userlevel=rs("userlevel")
else
rs.close
conn.close
response.write "没有记录"
response.end
end if
'打开数据库,读出个人档案
set rs=server.createobject("adodb.recordset")
sql="select * from personinf where username='" & sqlstr(username) & "'"
rs.cursorLocation = 3
rs.open sql,conn,1,1
dim a(33)
if not (rs.eof and rs.bof) then
for i=1 to 33
a(i)=rs("a" & i)
next
inputdate=rs("inputdate")
updatedate=rs("updatedate")
havephoto=rs("havephoto")
id=rs("id")
else
for i=1 to 33
a(i)=""
next
inputdate=""
updatedate=""
havephoto="no"
end if
rs.close
conn.close
%>
谢谢。。。不过还是不行啊。。 展开
'读出姓名、部门、职位
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select name,userdept,userlevel from userinf where username='" & sqlstr(username) & "'"
rs.cursorLocation = 3
rs.open sql,conn,1,1
If Not (rs.eof and rs.bof) then
name=rs("name")
userdept=rs("userdept")
userlevel=rs("userlevel")
else
rs.close
conn.close
response.write "没有记录"
response.end
end if
'打开数据库,读出个人档案
set rs=server.createobject("adodb.recordset")
sql="select * from personinf where username='" & sqlstr(username) & "'"
rs.cursorLocation = 3
rs.open sql,conn,1,1
dim a(33)
if not (rs.eof and rs.bof) then
for i=1 to 33
a(i)=rs("a" & i)
next
inputdate=rs("inputdate")
updatedate=rs("updatedate")
havephoto=rs("havephoto")
id=rs("id")
else
for i=1 to 33
a(i)=""
next
inputdate=""
updatedate=""
havephoto="no"
end if
rs.close
conn.close
%>
谢谢。。。不过还是不行啊。。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询