DW MX Command - error!

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default DW MX Command - error!

    Hi All.

    I've created a command throught the DWmx command server behaviour. I've
    followed the tutorial from [url]http://www.drdev.net/article01.htm[/url] but get the
    following error:

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
    statement.
    /MyWebs/Dynamic Brochure/adm1n/add_product.asp, line 64

    Line 64 is: insert_product.Execute()

    Has anyone else had the same problem? what's wrong with it? My code is
    below:

    <% If Request("Submit") <> "" Then %>
    <%
    set insert_product = Server.CreateObject("ADODB.Command")
    insert_product.ActiveConnection = MM_Online_Brochure_STRING
    insert_product.CommandText = "INSERT INTO products (" +
    Replace(insert_product__CategoryID, "'", "''") + ", " +
    Replace(insert_product__Product_Title, "'", "''") + ", " +
    Replace(insert_product__Product_Description, "'", "''") + ", " +
    Replace(insert_product__Product_Image, "'", "''") + ") VALUES ( ) "
    insert_product.CommandType = 1
    insert_product.CommandTimeout = 0
    insert_product.Prepared = true
    insert_product.Execute()
    %>
    <% End If %>



    Andy Guest

  2. Similar Questions and Discussions

    1. Error 403 Failed to read heders Error for long-runningCFMAIL and CFINDEX command
      I have two different pages with long-running scripts on which I am recieving the following error: Error - 403 Failed to read headers to server:...
    2. man command get error message
      Hi, I don't know what had happened with my system, but it seems like somthing wrong and caused many things behave strangely. One thing is for...
    3. Error command
      i encountered this error message (after spending 2 days redrawing a seriously complex logo for a client!): "Could not complete your request because...
    4. Postscript Print error (ERROR: rangecheck; OFFENDING COMMAND: filter)
      We are attempting to print off some rather large image files on a Xerox 340 and an HP Laserjet 4MV printer via Adobe Acrobat 6. Smaller similar files...
    5. Command Error
      hello there this is my first time on this forum and i hope i can find the help that i need :-) Ex: i open Dreamweaver and when i try to create a...
  3. #2

    Default Re: DW MX Command - error!

    From searching tinternet i found some code supplied by drewangell

    I change my code by hand to reflect his insert into and now my insert works.

    If i open the SW server behaviour, the code is re-written and then gives the
    error again. Does this behaviour have a bug?

    Andy

    BW SB Code:

    <%
    set insert_product = Server.CreateObject("ADODB.Command")
    insert_product.ActiveConnection = MM_Online_Brochure_STRING
    insert_product.CommandText = "INSERT INTO products (" +
    Replace(insert_product__categoryID, "'", "''") + ", " +
    Replace(insert_product__Product_Title, "'", "''") + ", " +
    Replace(insert_product__Product_description, "'", "''") + "," +
    Replace(insert_product__Product_Image, "'", "''") + ") VALUES (" +
    Replace(insert_product__categoryID, "'", "''") + ",' " +
    Replace(insert_product__Product_Title, "'", "''") + "','" +
    Replace(insert_product__Product_description, "'", "''") + "', '" +
    Replace(insert_product__Product_Image, "'", "''") + "') "
    insert_product.CommandType = 1
    insert_product.CommandTimeout = 0
    insert_product.Prepared = true
    insert_product.Execute()
    %>




    "Andy" <AndyjhughesNOSPAM@ntlworld.com> wrote in message
    news:d3leot$nk1$1@forums.macromedia.com...
    > Hi All.
    >
    > I've created a command throught the DWmx command server behaviour. I've
    > followed the tutorial from [url]http://www.drdev.net/article01.htm[/url] but get the
    > following error:
    >
    > Error Type:
    > Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    > [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
    > statement.
    > /MyWebs/Dynamic Brochure/adm1n/add_product.asp, line 64
    >
    > Line 64 is: insert_product.Execute()
    >
    > Has anyone else had the same problem? what's wrong with it? My code is
    > below:
    >
    > <% If Request("Submit") <> "" Then %>
    > <%
    > set insert_product = Server.CreateObject("ADODB.Command")
    > insert_product.ActiveConnection = MM_Online_Brochure_STRING
    > insert_product.CommandText = "INSERT INTO products (" +
    > Replace(insert_product__CategoryID, "'", "''") + ", " +
    > Replace(insert_product__Product_Title, "'", "''") + ", " +
    > Replace(insert_product__Product_Description, "'", "''") + ", " +
    > Replace(insert_product__Product_Image, "'", "''") + ") VALUES ( ) "
    > insert_product.CommandType = 1
    > insert_product.CommandTimeout = 0
    > insert_product.Prepared = true
    > insert_product.Execute()
    > %>
    > <% End If %>
    ********** hand code*************

    <%
    set insert_product = Server.CreateObject("ADODB.Command")
    insert_product.ActiveConnection = MM_Online_Brochure_STRING
    insert_product.CommandText = "INSERT INTO products (CategoryID,
    Product_Title, Product_description,Product_Image) VALUES (" +
    Replace(insert_product__categoryID, "'", "''") + ",' " +
    Replace(insert_product__Product_Title, "'", "''") + "','" +
    Replace(insert_product__Product_description, "'", "''") + "', '" +
    Replace(insert_product__Product_Image, "'", "''") + "') "
    insert_product.CommandType = 1
    insert_product.CommandTimeout = 0
    insert_product.Prepared = true
    insert_product.Execute()
    %>



    Andy Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139