Nuraida Anisa Bt Sobri 0 Report post Posted October 3, 2005 Assalamualaikum semua,saya nak minta bantuan sikit....saya tengah buat satu system guna dreamweaver dan asp..Tapi ada problem masa nak insert record dalam database(Access)keluar error type macam niMicrosoft OLE DB Provider for ODBC Drivers (0x80040E14)[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.bantu saya ok tq... Share this post Link to post Share on other sites
melayu4ever 0 Report post Posted October 3, 2005 boleh paste your INSERT script here ? Share this post Link to post Share on other sites
Nuraida Anisa Bt Sobri 0 Report post Posted October 3, 2005 <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%><!--#include file="Connections/staff1.asp" --><%' *** Edit Operations: declare variablesDim MM_editActionDim MM_abortEditDim MM_editQueryDim MM_editCmdDim MM_editConnectionDim MM_editTableDim MM_editRedirectUrlDim MM_editColumnDim MM_recordIdDim MM_fieldsStrDim MM_columnsStrDim MM_fieldsDim MM_columnsDim MM_typeArrayDim MM_formValDim MM_delimDim MM_altValDim MM_emptyValDim MM_iMM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)End If' boolean to abort record editMM_abortEdit = false' query string to executeMM_editQuery = ""%><%' *** Insert Record: set variablesIf (CStr(Request("MM_insert")) = "notice") Then MM_editConnection = MM_staff1_STRING MM_editTable = "notice" MM_editRedirectUrl = "viewmemo.asp" MM_fieldsStr = "fromnote|value|Tonote|value|TopicNote|value|note|value" MM_columnsStr = "From|',none,''|To|',none,''|Topic|',none,''|note1|',none,''" ' create the MM_fields and MM_columns arrays MM_fields = Split(MM_fieldsStr, "|") MM_columns = Split(MM_columnsStr, "|") ' set the form values For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_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 IfEnd If%><%' *** Insert Record: construct a sql insert statement and execute itDim MM_tableValuesDim MM_dbValuesIf (CStr(Request("MM_insert")) <> "") Then ' create the sql insert statement MM_tableValues = "" MM_dbValues = "" For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_formVal = MM_fields(MM_i+1) MM_typeArray = Split(MM_columns(MM_i+1),",") MM_delim = MM_typeArray(0) If (MM_delim = "none") Then MM_delim = "" MM_altVal = MM_typeArray(1) If (MM_altVal = "none") Then MM_altVal = "" MM_emptyVal = MM_typeArray(2) If (MM_emptyVal = "none") Then MM_emptyVal = "" If (MM_formVal = "") Then MM_formVal = MM_emptyVal Else If (MM_altVal <> "") Then MM_formVal = MM_altVal ElseIf (MM_delim = "'") Then ' escape quotes MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'" Else MM_formVal = MM_delim + MM_formVal + MM_delim End If End If If (MM_i <> LBound(MM_fields)) Then MM_tableValues = MM_tableValues & "," MM_dbValues = MM_dbValues & "," End If MM_tableValues = MM_tableValues & MM_columns(MM_i) MM_dbValues = MM_dbValues & MM_formVal Next MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")" If (Not MM_abortEdit) Then ' execute the insert Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.CloseIf (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End IfEnd If%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Main</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">.style7 {font-size: 14px}.style8 {font-size: 12px}body { background-color: #CCCCCC;}a:link { text-decoration: none; color: #333333;}a:visited { text-decoration: none; color: #333333;}a:hover { text-decoration: none; color: #0000FF;}a:active { text-decoration: none; color: #FF0000;}.style9 {color: #FF0000}.style10 {color: #FFFFFF}--></style></head><body><table width="768" height="420" border="1" align="center"> <tr> <th height="414" colspan="6" align="center" valign="baseline" bordercolor="#0000FF" bgcolor="#FFFFFF" scope="col"><table width="751" height="99" border="1" bordercolor="#99CCFF" bgcolor="#3399FF"> <tr> <th width="301" bgcolor="#99CCFF" scope="col"> </th> <th width="434" align="center" valign="top" bgcolor="#99CCFF" scope="col"><p class="style8">Welcome To Team Support System </p> <p class="style8"> </p></th> </tr> </table> <table width="749" border="1" bordercolor="#FF9900" bgcolor="#FFFFFF"> <tr> <th width="124" bordercolor="#0000FF" bgcolor="#FF9900" scope="col"><span class="style7">Notice Board </span></th> <th width="124" bordercolor="#0000FF" bgcolor="#FF9900" scope="col"><span class="style7">Message</span></th> <th width="124" bordercolor="#0000FF" bgcolor="#FF9900" scope="col"><span class="style7">Memo</span></th> <th width="124" bordercolor="#0000FF" bgcolor="#FF9900" scope="col"><span class="style7">Discussion</span></th> <th width="124" bordercolor="#0000FF" bgcolor="#FF9900" scope="col">Task</th> <th width="89" bordercolor="#0000FF" bgcolor="#FF9900" scope="col">Logout</th> </tr> </table> <table width="750" height="191" border="1"> <tr> <th width="200" height="185" align="center" valign="top" scope="col"><p class="style9">Notice Board</p> <table width="200" border="1"> <tr> <th bordercolor="#FFFF66" bgcolor="#3366FF" scope="col"><span class="style10">Actions</span></th> </tr> </table> <p class="style9"> </p></th> <th width="534" align="center" valign="top" scope="col"><p> </p> <table width="345" height="238" border="1" bordercolor="#000000"> <tr> <th width="563" height="23" bordercolor="#9999FF" bgcolor="#3366FF" scope="col"><div align="left" class="style10">Edit Notice </div></th> </tr> <tr><form METHOD="POST" ACTION="<%=MM_editAction%>" name="notice" id="notice"> <table width="318" border="1" bordercolor="#CCCCCC"> <tr align="center" valign="middle"> <th width="103" bordercolor="#666666" bgcolor="#CCCCCC" scope="col"><div align="justify"> <p>From:</p> </div></th> <th width="199" scope="col"> <div align="justify"> <p> <input name="fromnote" type="text" id="fromnote"> </p> </div></th> </tr> <tr align="center" valign="middle"> <th bordercolor="#666666" bgcolor="#CCCCCC" scope="row"><div align="justify"> <p>To:</p> </div></th> <td> <div align="justify"> <p> <input name="Tonote" type="text" id="Tonote"> </p> </div></td> </tr> <tr align="center" valign="middle"> <th bordercolor="#666666" bgcolor="#CCCCCC" scope="row"><div align="justify"> <p>Topic:</p> </div></th> <td> <div align="justify"> <p> <input name="TopicNote" type="text" id="TopicNote"> </p> </div></td> </tr> <tr align="center" valign="middle"> <th height="171" bordercolor="#666666" bgcolor="#CCCCCC" scope="row"><div align="justify"> <p>Note:</p> </div></th> <td> <div align="justify"> <p id="note" name="note"> <textarea name="note" cols="40" rows="10" id="note"></textarea> </p> </div></td> </tr> <tr> <th colspan="2" scope="row"><div align="center"> <input type="submit" name="Submit" value="Submit"> <input name="reset" type="reset" id="reset" value="Reset"> </div></th> </tr> </table> <input type="hidden" name="MM_insert" value="notice"> </form> <th height="207" align="left" valign="top" scope="row"></th> </tr> </table> <p> </p></th> </tr> </table> <p> </p></th> <th width="22" align="center" valign="top" bordercolor="#0000FF" bgcolor="#FFFFFF" scope="col"> </th> </tr></table><p> </p><p> </p><p> </p> </body></html>error ada at line 116 cang color merah Share this post Link to post Share on other sites
putera 0 Report post Posted October 7, 2005 kena install ini Microsoft OLE DB Provider for ODBC Driversboleh dapatkan kat mysql.com Share this post Link to post Share on other sites
Nuraida Anisa Bt Sobri 0 Report post Posted October 7, 2005 kena install ini Microsoft OLE DB Provider for ODBC Driversboleh dapatkan kat mysql.com←Thank you Share this post Link to post Share on other sites
C-Fu 0 Report post Posted October 7, 2005 (edited) no. dah ade le.1. dreamweaver ape yang ko gun?2. ni mesti ko buat insert record, pastu ade la ko edit ape2 cam tambah field ke ubah nama field ke, kan? 3. try delete semua kod2 insert record tu, pastu start dari mula (untuk step2 insert record dalam dreamweaver). pasal kengkadang kalo ko ubah ape2 lepas ko dah gune insert record function dalam dreamweaver nanti kod die jadi tak betul. Edited October 7, 2005 by C-Fu Share this post Link to post Share on other sites
DarkWan 3 Report post Posted October 8, 2005 cara yg paling senang+keji+dirty utk setelkan problem ni, buang semua code yg berkaitan dengan asp, tinggalkan base HTML tu je, pastu buat balik dari mula insert record tu - mcm C-Fu kata tu.konon-konon ada problem kat MM_editCmd.Execute tu tapi sebenarnya tak pun. code dreamweaver tu sendiri yg dh messed up. kalau guna wizard mmg mcm gini. redha je la dik .. Share this post Link to post Share on other sites
Nuraida Anisa Bt Sobri 0 Report post Posted October 8, 2005 Ok thank u semua saya dah dpt difind the problem Thank You Share this post Link to post Share on other sites
DarkWan 3 Report post Posted October 8, 2005 Err .. masalah dah setel dah ? Boleh totop topik ..?? Share this post Link to post Share on other sites