Menu

#17 Syntax Error (missing operator)

open
nobody
None
5
2007-08-29
2007-08-29
Tony
No

80040E14: Syntax error (missing operator) in query expression 'Part Number'

This error appears on some tables but not others that use the 'Part Number' field.
Other tables display fine.
The error also happens on other fields as well ('PK No' for example).

Discussion

  • Tony

    Tony - 2007-08-29

    Logged In: YES
    user_id=1878507
    Originator: YES

    This appears to be only when 'Part Number' or 'PK No' are primary fields. It does not affect a 'Part Number' field that is not a primary field.

     
  • Nobody/Anonymous

    Logged In: NO

    I found that the generated SQL did not use the [Part Number] form for the query, i.e. with square brackets.
    I therefore modified the folowing two lines in the ute_class.inc file

    In getAllRecordsFromDB

    from
    m_sSQL = "SELECT * FROM " & m_sTable
    to
    m_sSQL = "SELECT * FROM [" & m_sTable &"]"

    from
    s = s & m_SortFields(i)
    to
    s = s & "[" & m_SortFields(i) & "]"

    For me at least I can now see the tables and fields in my database.
    Thanks to the guys who write and support this code. Much respect, and I hope my kludge is of help....
    s g c o u g h l a n @_h o t m a i l . c o m
    remove the spaces and underscore...... ;)

     
  • Nobody/Anonymous

    Logged In: NO

    This issue seems to permiate the code, I am in the process of modifying and testing the code. If you know how to debug the code the affore mentioned sugestion may help you solve a couple of other issues as well.

     
  • Tony

    Tony - 2007-11-08

    Logged In: YES
    user_id=1878507
    Originator: YES

    Thank you 'nobody'. That was very helpful and solved this problem very well.

    However, this symptom has permiated through the code. I have found that the filters have a similar problem of not addressing fields that have a space in the description (ie 'Part Number' does not work as the code assumes that the space is not part of the field name. This needs changing to [Part Number] in this area too).

    Can you identify the section of code that performs this function?

    Regards

    Tony

     
  • Tony

    Tony - 2007-11-08

    Logged In: YES
    user_id=1878507
    Originator: YES

    Thank you 'nobody'. That was very helpful and solved this problem very well.

    However, this symptom has permiated through the code. I have found that the filters have a similar problem of not addressing fields that have a space in the description (ie 'Part Number' does not work as the code assumes that the space is not part of the field name. This needs changing to [Part Number] in this area too).

    Can you identify the section of code that performs this function?

    Regards

    Tony

     
  • Tony

    Tony - 2007-11-08

    Logged In: YES
    user_id=1878507
    Originator: YES

    Thank you 'nobody'. That was very helpful and solved this problem very well.

    However, this symptom has permiated through the code. I have found that the filters have a similar problem of not addressing fields that have a space in the description (ie 'Part Number' does not work as the code assumes that the space is not part of the field name. This needs changing to [Part Number] in this area too).

    Can you identify the section of code that performs this function?

    Regards

    Tony

     
  • Nobody/Anonymous

    Logged In: NO

    Ok ... well if you wanted and update here goes......

    ute_class_form.inc

    sSQL = sCmd & " FROM " & m_sTable
    sSQL = sCmd & " FROM " & "[" & m_sTable & "]" '' *** SGC Added enclosing brackets

    sSQL = sSQL & AddWhere (sField, nType, sValue, "=", "AND", bFirst)
    sSQL = sSQL & AddWhere ("[" & sField & "]", nType, sValue, "=", "AND", bFirst) '' *** SGC Added enclosing brackets

    ute_class.inc

    m_FilterFields(UBound(m_FilterFields)) = Request.QueryString(sParamFilterField & CStr(j))
    m_FilterFields(UBound(m_FilterFields)) = "[" & Request.QueryString(sParamFilterField & CStr(j)) & "]" '' *** SGC Added enclosing brackets

    m_sSQL = "SELECT * FROM " & m_sTable
    m_sSQL = "SELECT * FROM [" & m_sTable &"]" '' *** SGC Added enclosing brackets

    s = s & m_SortFields(i)
    s = s & "[" & m_SortFields(i) & "]" '' *** SGC Added enclosing brackets

    I can now edit my tables as well...... :-)

    hope my kludge is of help....
    s g c o u g h l a n @_h o t m a i l . c o m
    remove the spaces and underscore...... ;)

     
  • Nobody/Anonymous

    Logged In: NO

    This change stops the FILTER from leaping out of a FRAME....

    ute_class_filter.inc

    buildFilterCountList

    "onChange=""jumpPage('parent', this, 0)"">" & vbCrLf *** SGC
    "onChange=""jumpPage('self', this, 0)"">" & vbCrLf

    hope my further kludge is of help....
    s g c o u g h l a n @_h o t m a i l . c o m
    remove the spaces and underscore...... ;)

     
  • Nobody/Anonymous

    Logged In: NO

    The following modification is quite useful ;)

    It allows all objects in the database table list to be displayed. Now I can access Linked Tables.

    ute_class_database.inc

    buildHTML_Database

    ' if UCase(rstSchema("TABLE_TYPE")) = "TABLE" then
    if UCase(rstSchema("TABLE_TYPE")) > "" then ' *** SGC

    hope my further, further kludge is of even more help....
    s g c o u g h l a n @_h o t m a i l . c o m
    remove the spaces and underscore...... ;)

     
  • Nobody/Anonymous

    Another modification / kludge
    This lists the table types I needed but excludes the system tables (and possibly others that may be required) I also added the database table type by modifying the HTML table with the addition of a column. As such the routine below replaces the existing routine in the ute_class_database.inc file

    {You may have to sort out line wrapping issues if you copy and paste the code.}

    ''--------------------------------------------------------------------------
    '' Name: buildHTML_Database
    '' ==================
    ''
    '' Creates entire UTE HTML code for database mode.
    ''
    '' Parameter:
    '' none
    ''
    '' return value:
    '' string HTML code
    ''
    ''--------------------------------------------------------------------------
    Private Function buildHTML_Database()
    Dim sValue, s
    Dim rstSchema

    if m_sDBName <> "" then
    s = Replace(STR_DB_TITLE, "%1", m_sDBName)
    else
    s = Replace(STR_DB_TITLE, "%1", STR_DATABASE)
    end if

    sValue = _
    "<p><span class=""ute_headline"">" & s & "</span></p>" & vbCrLf & _
    "<table width=""100%"">" & vbCrLf
    ' "<table width=""100%"">" & "<tr>" & vbCrLf & _ ' *** SGC
    ' "<td class=""ute_navigation"">" & vbCrLf & _ ' *** SGC
    ' "<ul class=""ute_table_list"">" & vbCrLf ' *** SGC

    Set rstSchema = m_DB.OpenSchema(adSchemaTables)
    Do Until rstSchema.EOF

    ' Response.Write rstSchema("TABLE_TYPE") & " " & rstSchema("TABLE_NAME") & "<BR>" ' *** SGC

    if UCase(rstSchema("TABLE_TYPE")) = "TABLE" OR UCase(rstSchema("TABLE_TYPE")) = "LINK" OR UCase(rstSchema("TABLE_TYPE")) = "VIEW" then
    sValue = sValue & "<tr>" & "<td class=""ute_navigation"">" & "<ul class=""ute_table_list"">"
    s = Request.QueryString
    s = getLink(m_sUTEScript, s, sParamTable, rstSchema("TABLE_NAME"))
    s = getLink(m_sUTEScript, s, sParamMode, MD_TABLE)
    sValue = sValue & "<li><a href=""" & s & """>" & rstSchema("TABLE_NAME") & "</td>"
    sValue = sValue & "<td class=""ute_navigation"">" & rstSchema("TABLE_TYPE") & "</td></tr>" & vbCrLf
    end if
    rstSchema.MoveNext
    Loop
    rstSchema.Close
    Set rstSchema = Nothing

    sValue = sValue & _
    "</ul>" & vbCrLf & _
    "</td></tr></table>" & vbCrLf & _
    getPoweredBy

    buildHTML_Database = sValue

    End Function

     
  • Nobody/Anonymous

    One I missed earlier .... arghhhhhh
    ute_class_form.inc

    Private Sub InitForm ()
    .....

    ' m_RSForm.Open m_sTable, m_DB, adOpenStatic, adLockPessimistic, adCmdTable
    m_RSForm.Open "[" & m_sTable & "]", m_DB, adOpenStatic, adLockPessimistic, adCmdTable ' *** SGC

    This allows adding of records to tables with spaces in the table names.

     

Log in to post a comment.

MongoDB Logo MongoDB