Why am i getting errors from the Wizards code
Microsoft JET Database Engine error '80040e14'
Syntax error in FROM clause.
/speaker_system_beta/TBL Speaker Biography_Update.asp, line 22
When i adjust the wizards code it then works
Wizards code:
Set WADATBLSpeakerBiography_cmd = Server.CreateObject ("ADODB.Command")
WADATBLSpeakerBiography_cmd.ActiveConnection = MM_speaker_bio_entry_STRING
WADATBLSpeakerBiography_cmd.CommandText = "SELECT ID, [Contact Photo] FROM TBL Speaker Biography"
WADATBLSpeakerBiography_cmd.Prepared = true
When I add square brackets around the from table it works - FROM [TBL Speaker Biography]
Update page errors
Here is the error i am getting:
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
/speaker_system_beta/TBL Speaker Biography_Update.asp, line 57
Here is the asp code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../WA_DataAssist/WA_AppBuilder_VB.asp" -->
<!--#include file="../Connections/speaker_bio_entry.asp" -->
<%
Dim WADATBLSpeakerBiography__ParamID
WADATBLSpeakerBiography__ParamID = "-1"
If (Request.QueryString("ID") <> "") Then
WADATBLSpeakerBiography__ParamID = Request.QueryString("ID")
End If
%>
<%
Dim WADATBLSpeakerBiography
Dim WADATBLSpeakerBiography_cmd
Dim WADATBLSpeakerBiography_numRows
Set WADATBLSpeakerBiography_cmd = Server.CreateObject ("ADODB.Command")
WADATBLSpeakerBiography_cmd.ActiveConnection = MM_speaker_bio_entry_STRING
WADATBLSpeakerBiography_cmd.CommandText = "SELECT ID, [Contact Photo] FROM [TBL Speaker Biography] WHERE ID = ?"
WADATBLSpeakerBiography_cmd.Prepared = true
WADATBLSpeakerBiography_cmd.Parameters.Append WADATBLSpeakerBiography_cmd.CreateParameter("param1", 5, 1, -1, WADATBLSpeakerBiography__ParamID) ' adDouble
Set WADATBLSpeakerBiography = WADATBLSpeakerBiography_cmd.Execute
WADATBLSpeakerBiography_numRows = 0
%>
<%
' WA Application Builder Update
if (cStr(Request.Form("Update")) <> "") then
WA_connection = MM_speaker_bio_entry_STRING
WA_table = "TBL Speaker Biography"
WA_redirectURL = "TBL Speaker Biography_Results.asp"
WA_keepQueryString = false
WA_indexField = "ID"
WA_fieldNamesStr = "Contact Photo"
WA_fieldValuesStr = "" & cStr(cStr(Request.Form("Contact Photo"))) & ""
WA_columnTypesStr = "',none,''"
WA_comparisonStr = " LIKE "
WA_fieldNames = Split(WA_fieldNamesStr,"|")
WA_fieldValues = Split(WA_fieldValuesStr,"|")
WA_columns = Split(WA_columnTypesStr,"|")
WA_comparisions = Split(WA_comparisonStr, "|")
WA_where_fieldValuesStr = "" & cStr(cStr(Request.Form("WADAUpdateRecordID"))) & ""
WA_where_columnTypesStr = "none,none,NULL"
WA_where_comparisonStr = "="
WA_where_fieldNames = Split(WA_indexField,"|")
WA_where_fieldValues = Split(WA_where_fieldValuesStr,"|")
WA_where_columns = Split(WA_where_columnTypesStr,"|")
WA_where_comparisions = Split(WA_where_comparisonStr, "|")
updateParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
WhereObj = WA_AB_generateWhereClause(WA_where_fieldNames, WA_where_columns, WA_where_fieldValues, WA_where_comparisions)
set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = WA_connection
MM_editCmd.CommandText = "UPDATE " & WA_table & " SET " & updateParamsObj(3) & " WHERE " & WhereObj & ""
MM_editCmd.Execute()
MM_editCmd.ActiveConnection.Close()
if (WA_redirectURL <> "") then
if (WA_keepQueryString AND Request.QueryString <> "" AND Request.QueryString.Count > 0) then
if (inStr(WA_redirectURL,"?") > 0) then
WA_redirectURL = WA_redirectURL & "&"
else
WA_redirectURL = WA_redirectURL & "?"
end if
WA_redirectURL = WA_redirectURL & Request.QueryString
end if
Response.Redirect(WA_redirectURL)
end if
end if
%>