So, the answer is:
MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param6", 5, 1, -1,
MM_IIF(Request.Form("deletevoucher"), 1, 0)) ' adDouble
This is what Dreamweaver automatically inserts as the
"correct" code (which
doesn't work):
MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param6", 5, 1, -1,
MM_IIF(Request.Form("deletevoucher"),
Request.Form("deletevoucher"), null))
' adDouble
Questions:
1) Why has DW doubled up the Request.Form("deletevoucher")
bit?
2) Why has it inserted "null" for the checkbox when it
clearly should be 1,
0?
3) Why can't DW automatically detect that the item is a
checkbox and code
the UPDATE accordingly? Now, I know people will say "DW is
only good for
basics" but, jeesh, a simple check box in an update form is
hardly rocket
science these days, is it? I know it's rocket science to ME,
but I mean in
web design software terms, it's hardly a "biggie" now is it?
Am I asking too much for the £750.00+ I paid for Studio?
:o(
Frustrating, frustrating software.
Nath.
"tradmusic.com" <sales@NOSHPAMtradmusic.com> wrote in
message
news:etp0th$4j5$1@forums.macromedia.com...
> Sorry, but I've just "burst" with anger and need some
help. :o)
> ASP/VBScript/MSSQL
>
> I have an UPDATE form that has a checkbox. If the
checkbox field in the
> database is "True" it displays a checked check box, if
it is "False" it
> displays an unchecked check box.
>
> If a user places a check in the checkbox and submits the
UPDATE form, I am
> getting the following error:
> Wrong number of arguments or invalid property
assignment: 'MM_IIf'
> Line 40
>
> Line 40 is, of course, the reference to the checkbox:
> MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param6", 5,
> 1, -1, MM_IIF(Request.Form("deletevoucher"),
> Request.Form("deletevoucher"), null)) ' adDouble
>
> Now, I know that I need to change the type here. Can
some kind soul
> please tell me what it SHOULD be?
>
> It is this kind of problem that makes me want to through
Dreamweaver out
> of the window and please don't patronise me with "it
isn't Dreamweavers
> fault". DW creates the incorrect code...who elses fault
is it?? Tired,
> oh so very tired, of Dreamweaver.
>
> Thank you, in advance, for any advice offered.
> Nath.
>
> (it has been a long day)
>