Syntax error -- data type issue?

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

  1. #1

    Default Syntax error -- data type issue?

    Hi,

    I keep getting the following error when testing a page with form to insert
    record.

    System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement.
    at System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(Int32 hr)
    .......

    Parameters are set as follows:
    <Parameter Name="@address" Value='<%# IIf((Request.Form("address") <>
    Nothing), Request.Form("address"), "") %>' Type="WChar" />
    <Parameter Value='<%# IIf((Request.Form("average_cost") <> Nothing),
    Request.Form("average_cost"), "") %>' direction="Input" Name="@average_cost"
    Type="Currency" />
    <Parameter Name="@city" Value='<%# IIf((Request.Form("city") <> Nothing),
    Request.Form("city"), "") %>' Type="WChar" />
    <Parameter Value='<%# IIf((Request.Form("cost_id") <> Nothing),
    Request.Form("cost_id"), "") %>' direction="Input" Name="@cost_id"
    Type="Integer" />
    <Parameter Name="@date_created" Value='<%#
    IIf((Request.Form("date_created") <> Nothing), Request.Form("date_created"),
    "") %>' Type="Date" />
    <Parameter Name="@hours" Value='<%# IIf((Request.Form("hours") <>
    Nothing), Request.Form("hours"), "") %>' Type="WChar" />
    <Parameter Name="@name" Value='<%# IIf((Request.Form("name") <> Nothing),
    Request.Form("name"), "") %>' Type="WChar" />
    <Parameter Name="@note" Value='<%# IIf((Request.Form("note") <> Nothing),
    Request.Form("note"), "") %>' Type="WChar" />
    <Parameter Name="@payment" Value='<%# IIf((Request.Form("payment") <>
    Nothing), Request.Form("payment"), "") %>' Type="WChar" />
    <Parameter Name="@phone" Value='<%# IIf((Request.Form("phone") <>
    Nothing), Request.Form("phone"), "") %>' Type="WChar" />
    <Parameter Name="@reservation" Value='<%# IIf((Request.Form("reservation")
    <> Nothing), Request.Form("reservation"), "") %>' Type="WChar" />
    <Parameter Name="@states" Value='<%# IIf((Request.Form("states") <>
    Nothing), Request.Form("states"), "") %>' Type="WChar" />
    <Parameter Value='<%# IIf((Request.Form("style_id") <> Nothing),
    Request.Form("style_id"), "") %>' direction="Input" Name="@style_id"
    Type="Integer" />

    i tried numeric, bigint and a few other types for where i used integer or
    currency, but no luck. Does anyone have a suggestion where i should look into?
    I use Access database.

    thank you for your help.
    tchen

    tchen314 Guest

  2. Similar Questions and Discussions

    1. #39056 [NEW]: Interbase NUMERIC data type error
      From: ddi at elecom dot ru Operating system: All PHP version: 5.1.6 PHP Bug Type: InterBase related Bug description: ...
    2. data type mismatch error...
      HI guys, getting pretty stressed with this haha! it's probably something simple...right I have this registration form that does multiple checks...
    3. Webservice and complex data type issue
      I created a webservice that returned a structure which .Net doesn't seem to like. So I created a complex type using component and cfproperty to...
    4. Converting data type varchar to data type money
      Hi all, Tearing my hair out trying to figure this out. If anyone can provide any help i would greatly appreciate it. When I try to do an insert...
    5. <<Error converting data type char to smalldatetime>>
      Hi All (IIS 5, SQL 2k, Win 2k) I'm stumped and can't find where I would be "mis-converting" data. I receive the following error ONLY when I update...
  3. #2

    Default Re: Syntax error -- data type issue?

    "name" is a reserved word and should not be used in database field names.
    This is most likely causing the error.

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "tchen314" <webforumsuser@macromedia.com> wrote in message
    news:d4f5lm$r5t$1@forums.macromedia.com...
    > Hi,
    >
    > I keep getting the following error when testing a page with form to
    insert
    > record.
    >
    > System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement.
    > at System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(Int32
    hr)
    > ......
    >
    > Parameters are set as follows:
    > <Parameter Name="@address" Value='<%# IIf((Request.Form("address") <>
    > Nothing), Request.Form("address"), "") %>' Type="WChar" />
    > <Parameter Value='<%# IIf((Request.Form("average_cost") <> Nothing),
    > Request.Form("average_cost"), "") %>' direction="Input"
    Name="@average_cost"
    > Type="Currency" />
    > <Parameter Name="@city" Value='<%# IIf((Request.Form("city") <>
    Nothing),
    > Request.Form("city"), "") %>' Type="WChar" />
    > <Parameter Value='<%# IIf((Request.Form("cost_id") <> Nothing),
    > Request.Form("cost_id"), "") %>' direction="Input" Name="@cost_id"
    > Type="Integer" />
    > <Parameter Name="@date_created" Value='<%#
    > IIf((Request.Form("date_created") <> Nothing),
    Request.Form("date_created"),
    > "") %>' Type="Date" />
    > <Parameter Name="@hours" Value='<%# IIf((Request.Form("hours") <>
    > Nothing), Request.Form("hours"), "") %>' Type="WChar" />
    > <Parameter Name="@name" Value='<%# IIf((Request.Form("name") <>
    Nothing),
    > Request.Form("name"), "") %>' Type="WChar" />
    > <Parameter Name="@note" Value='<%# IIf((Request.Form("note") <>
    Nothing),
    > Request.Form("note"), "") %>' Type="WChar" />
    > <Parameter Name="@payment" Value='<%# IIf((Request.Form("payment") <>
    > Nothing), Request.Form("payment"), "") %>' Type="WChar" />
    > <Parameter Name="@phone" Value='<%# IIf((Request.Form("phone") <>
    > Nothing), Request.Form("phone"), "") %>' Type="WChar" />
    > <Parameter Name="@reservation" Value='<%#
    IIf((Request.Form("reservation")
    > <> Nothing), Request.Form("reservation"), "") %>' Type="WChar" />
    > <Parameter Name="@states" Value='<%# IIf((Request.Form("states") <>
    > Nothing), Request.Form("states"), "") %>' Type="WChar" />
    > <Parameter Value='<%# IIf((Request.Form("style_id") <> Nothing),
    > Request.Form("style_id"), "") %>' direction="Input" Name="@style_id"
    > Type="Integer" />
    >
    > i tried numeric, bigint and a few other types for where i used integer or
    > currency, but no luck. Does anyone have a suggestion where i should look
    into?
    > I use Access database.
    >
    > thank you for your help.
    > tchen
    >

    Paul Whitham TMM Guest

  4. #3

    Default Re: Syntax error -- data type issue?

    Thank you! name and note are reserved words. it's working now.

    tchen
    tchen314 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