主题:  数据库不好用

huyaowen

职务:普通成员
等级:1
金币:0.0
发贴:20
注册:2001/10/5 19:15:57
#12001/10/5 19:32:18
症状如下,请help:

Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.

/scdldx/usersofscdldx/updatelogin.asp, line 89


感激不尽



tonton_5d

职务:普通成员
等级:2
金币:1.0
发贴:176
注册:2001/8/7 23:57:56
#22001/10/5 19:35:00
SQL语句出错!


免费提供XML计数器服务 www.tonton.cn

風雲

职务:普通成员
等级:2
金币:1.0
发贴:281
注册:2001/6/24 14:11:35
#32001/10/6 3:17:52
看看您的scdldx/usersofscdldx/updatelogin.asp第89行到底出了什么问题。



huyaowen

职务:普通成员
等级:1
金币:0.0
发贴:20
注册:2001/10/5 19:15:57
#42001/10/7 17:07:42
我的数据库中有一个保留字update,但我在ASP页中不用它呀,我是给它做了个默认值。这有影响吗、?



huyaowen

职务:普通成员
等级:1
金币:0.0
发贴:20
注册:2001/10/5 19:15:57
#52001/10/7 17:16:47
全部内容如下请help,不胜感激|!、!

<%@LANGUAGE="VBSCRIPT"%>

<%
' *** Edit Operations: declare variables

MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables

If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then

MM_editConnection = MM_dsn_STRING
MM_editTable = "normal"
MM_editColumn = "id"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "okupdate.html"
MM_fieldsStr = "pass1|value|radiobutton|value|old|value|addr|value|tel|value|qq|value|email|value|luckynu|value|dowhat|value|intro|value"
MM_columnsStr = "pass|',none,''|sex|',none,''|old|none,none,NULL|add|',none,''|tel|',none,''|qq|none,none,NULL|email|',none,''|luckynum|',none,''|do_what|',none,''|intro|',none,''"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")

' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%>
<%
' *** Update Record: construct a sql update statement and execute it

If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then

' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),",")
Delim = MM_typeArray(0)
If (Delim = "none") Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none") Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none") Then EmptyVal = ""
If (FormVal = "") Then
FormVal = EmptyVal
Else
If (AltVal <> "") Then
FormVal = AltVal
ElseIf (Delim = "'") Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''") & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(i) & " = " & FormVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId

If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
if (Request.Form("uname") <> "") then Recordset1__MMColParam = Request.Form("uname")
%>
<%
Dim Recordset1__mmpass
Recordset1__mmpass = "1"
if (Request.Form("upass") <> "") then Recordset1__mmpass = Request.Form("upass")
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_dsn_STRING
Recordset1.Source = "SELECT * FROM normal WHERE flying_name = '" + Replace(Recordset1__MMColParam, "'", "''") + "' AND pass='" + Replace(Recordset1__mmpass, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' set the record count
Recordset1_total = Recordset1.RecordCount

' set the number of rows displayed on this page
If (Recordset1_numRows < 0) Then
Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
Recordset1_numRows = 1
End If

' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1

' if we have the correct record count, check the other stats
If (Recordset1_total <> -1) Then
If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total
If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total
If (Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total
End If
%>
<%
' *** Move To Record and Go To Record: declare variables

Set MM_rs = Recordset1
MM_rsCount = Recordset1_total
MM_size = Recordset1_numRows
MM_uniqueCol = "id"
MM_paramName = "scid"
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Specific Record: handle detail parameter

If (MM_paramIsDefined And MM_rsCount <> 0) Then

' get the value of the parameter
param = Request.QueryString(MM_paramName)

' find the record with the unique column value equal to the parameter value
MM_offset = 0
Do While (Not MM_rs.EOF)
If (Cstr(MM_rs.Fields.Item(MM_uniqueCol).value) = param) Then
Exit Do
End If
MM_offset = MM_offset + 1
MM_rs.MoveNext
Loop

' if not found, set the number of records and reset the cursor
If (MM_rs.EOF) Then
If (MM_rsCount < 0) Then MM_rsCount = MM_offset
If (MM_size < 0 Or MM_size > MM_offset) Then MM_size = MM_offset
MM_offset = 0

' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Close
MM_rs.Open
End If
End If

End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range

If (MM_rsCount = -1) Then

' walk to the end of the display range for this page
i = MM_offset
While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
MM_rs.MoveNext
i = i + 1
Wend

' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = i
If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
End If

' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) > 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If

' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If

' move the cursor to the selected record
i = 0
While (Not MM_rs.EOF And i < MM_offset)
MM_rs.MoveNext
i = i + 1
Wend
End If
%>
<%
' *** Move To Record: update recordset stats

' set the first and last displayed record
Recordset1_first = MM_offset + 1
Recordset1_last = MM_offset + MM_size
If (MM_rsCount <> -1) Then
If (Recordset1_first > MM_rsCount) Then Recordset1_first = MM_rsCount
If (Recordset1_last > MM_rsCount) Then Recordset1_last = MM_rsCount
End If

' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>


D??¢?ü??




ê×?è£?è?1???óD???àòaé?′?μ??°£?μ??÷?aà?(×?????)



?üD???μ?D??¢£o(*?a±?Dè??)


?ó?±<%=(Recordset1.Fields.Item("chinese_name").value)%>μ?D??¢:

?ó?ú??£o <%=(Recordset1.Fields.Item("flying_name").value)%>

?ó?ú?°??:<%=(Recordset1.Fields.Item("major_in").value)%>

?úμ??ü??£o
">
*

?úμ?D?±e£o

?D  ??????

?? *

?úμ??êá?£o
">
*

áa?μμ??·£o
">
*

áa?μμ??°£o
">


áa?μ£?£?£o
">
*

áa?μμ?óê£o
">
*

Dò??êy×?£o
">
*

??μ??°òμ£o
">
*

?μ?μ×?ò?£o










">

 




<%
Recordset1.Close()
%>



huyaowen

职务:普通成员
等级:1
金币:0.0
发贴:20
注册:2001/10/5 19:15:57
#62001/10/12 18:03:59
没人帮我
55555
:——(



rainer5

职务:普通成员
等级:1
金币:0.0
发贴:8
注册:2001/10/11 0:18:58
#72001/10/13 1:12:41
错误就在你的89行update语句之后的一系列IF,FOR 中。