שלח תשובה

זירת השאלות

7293
צפיות
5
תשובות

יש לי שגיאה….

,‏ 2 בינואר, 2005



Microsoft JET Database Engine error '80040e14'

The INSERT INTO statement contains the following unknown field name: 'Question'. Make sure you have typed the name correctly, and try the operation again.

/noimanshai/poll/Padd.asp, line 20



והקוד



<% Dim Conn, rs, SQL
    
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("PollDb.mdb")
Set rs = Server.CreateObject("ADODB.RecordSet")

Dim Status,Question,newID,ans

Status = Request.Form("Online")
If Status="" Then Status=0
If Status=1 Then
   conn.Execute "UPDATE pl_Question SET Status=2 WHERE Status=1"
End If

dim sql

Question= Replace(Request.Form("Question"),"'",""")
sql = "INSERT INTO pl_Question (Question,Status) VALUES ('"
sql = sql & Question & "'," & Status & ")"
conn.Execute sql

rs.Open "SELECT MAX(ID) as newID FROM pl_Question",conn
newID=rs("newID")
rs.Close



תגיות:

5 תשובות

  1. שי נוימן הגיב:

    מישהו יכול להסביר לי


    Microsoft JET Database Engine error '80040e14'

    The INSERT INTO statement contains the following unknown field name: 'Question'. Make sure you have typed the name correctly, and try the operation again.

    /noimanshai/poll/PostPoll.asp, line 17

  2. Just-Tal הגיב:

    לא יעזור לך גם אם תשים…
    עוד 1000 הודעות. זה רק יעצבן אנשים ולא יעזרו לך.

    תמתין בסבלנות ובסוף מישהו שידע מה זה יאמר לך.

  3. העקרב הגיב:

    אני חושב… ולפעם הבאה, אל תציף ככה

  4. העקרב הגיב:

    הקוד: XD

    <% Dim Conn, rs, SQL
        
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("PollDb.mdb")
    Set rs = Server.CreateObject("ADODB.RecordSet")

    Dim Status,Question,newID,ans

    Status = Request.Form("Online")
    If Status="" Then Status=0
    If Status=1 Then
       conn.Execute "UPDATE pl_Question SET Status=2 WHERE Status=1"
    End If

    dim sql

    Question= Replace(Request.Form("Question"),"'",""")
    sql = "INSERT INTO pl_Question (Question,Status) VALUES ("
    sql = sql '"& Question & "','" & Status & "')"
    conn.Execute sql

    rs.Open "SELECT MAX(ID) as newID FROM pl_Question",conn
    newID=rs("newID")
    rs.Close

  5. זהר פלד הגיב:

    ובנוסף,
    יש מאמר במדור ASP על איך לדבג SQL…
    מומלץ בחום (ולא רק בגלל שאני כתבתי אותו)

שלח תשובה