gpt4 book ai didi

html - ODB 错误 80040e14 ASP 经典

转载 作者:行者123 更新时间:2023-11-29 07:45:48 24 4
gpt4 key购买 nike

我的代码有什么问题吗?继续显示此错误消息

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 5.2(w) Driver][mysqld-5.5.28-log]You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax
to use near ''' at line 1

/login/update2.asp, line 12

Line 12 Set rs = objRS.Execute(mySQL)

    <%
DIM strUsername
strUsername = Request.Form("Username")
IF strUsername <> "" THEN
%>

<%
DIM mySQL, objRS
mySQL = "SELECT username, email_addr FROM medacist_user WHERE username = " & strUsername & " ' "
Set objRS = Server.CreateObject("ADODB.Connection")
objRS.Open "Provider=MSDASQL.1;Password=langas;Persist Security Info=True;User ID=mmsg;Data Source=mmsg_web"
Set rs = objRS.Execute(mySQL)

IF objRS.EOF THEN
Response.Write "<div align='center'>Sorry, that username does not exist. Please click back on your browser and enter a different username.</div>"

ELSE
%>

<form name="UpdatePassword" method="post" action="reset_form.asp">
<table>
<tr><td>Customer:</td><td>
<input type="text" name="Username" size="50" value='<%=objRS("Username")%>'>
</td></tr>
<tr><td>Password:</td><td>
<input type="text" name="Password" size="50" value='<%=objRS("Password")%>'>
</td></tr>
</table>
<input type="submit" name="Submit" value="Submit">
</form>

<%
END IF

objRS.Close
Set objRS = Nothing
%>

<%
ELSE
Response.Write "Please click back on your browser and enter your username."
END IF
%>

最佳答案

mySQL = "SELECT username, email_addr  FROM medacist_user WHERE username = '" & strUsername & " ' "

您添加了末尾撇号来指定字符串,而不是起始字符串。

关于html - ODB 错误 80040e14 ASP 经典,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27829433/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com