开发者社区> 问答> 正文

本人用Dreamweaver自定义连接字符串链接远程服务器数据库,连接脚本成功了,可我在查看数据时,提示“FROM 子句语法错误”?

本人也从网上看了,说的方法把名称之类的变量也改了,没有任何变化。如下代码:
<%@LANGUAGE="VBSCRIPT"%>

<%
' * Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("textname"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="/admin/landing_ok.asp"
MM_redirectLoginFailed="/admin/landing_err.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_web_STRING
MM_rsUser.Source = "SELECT web_name, web_password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM T_user WHERE web_name='" & Replace(MM_valUsername,"'","''") &"' AND web_password='" & Replace(Request.Form("textpassword"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then

' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
  Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
  Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
  MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)

End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>

展开
收起
千总 2016-05-02 23:25:48 3065 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
DTCC 2022大会集锦《云原生一站式数据库技术与实践》 立即下载
阿里云瑶池数据库精要2022版 立即下载
2022 DTCC-阿里云一站式数据库上云最佳实践 立即下载