set rs = conn.execute("SELECT MatID, VendID FROM Material_Vendor WHERE MatID
= '" & ArrMatID(i) & "' AND VendID = '" & iVendValue & "'")
I get a syntax error saying: Incorrect syntax near '196' , which is the ID
held in ArrMatID(i)
When I look at the statement in SQL Profiler, it shows ' '196' '
If I remove the single quotes from around, like this - " & ArrMatID(i) & ",
then SQL Profiler shows no quotes around 196. I know that I need quotes
around 196, but not sure why the page is complaining.
Any ideas?
Thanks,
Dean
--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com
"Dean Bolton" <de...@vdubn.com> wrote in message
news:a6b8bh$6...@dispatch.concentric.net...
is MatID an INT or VARCHAR column? If it is numeric, drop the single
quotes. Those are for strings. Otherwise, explain what you mean by "I know
that I need quotes" and exactly what profiler is showing in both cases.
Mikhail Berlyant
Data Integrator, Yahoo!Music www.yahoo.com
Brainbench MVP for Visual Basic www.brainbench.com
"Dean Bolton" <de...@vdubn.com> wrote in message
news:a6b8bh$6...@dispatch.concentric.net...
ArrMatID = Split(request.form("Attach"),", ")
For i=0 to ubound(ArrMatID)
I am pretty sure that all this does is separate the values separated by
commas.
Thanks,
Dean
"Manohar Kamath [MVP]" <mka...@TAKETHISOUTbeforeUMAILMEkamath.com> wrote in
message news:OvhouSuxBHA.2132@tkmsftngp02...
SELECT MatID, VendID FROM Material_Vendor WHERE MatID = '196' AND VendID = 3
How can I remove those?
Thanks,
Dean
"Aaron Bertrand [MVP]" <aaronATaspfaq.com> wrote in message
news:O34F5YuxBHA.1556@tkmsftngp03...
Mikhail Berlyant
Data Integrator, Yahoo!Music www.yahoo.com
Brainbench MVP for Visual Basic www.brainbench.com
-----Original Message-----
From: Dean Bolton [mailto:de...@igi-hq.com]
Sent: Friday, March 08, 2002 2:04 PM
To: Berlyant, Mikhail
Subject: Re: Syntax error in SQL Statement????
It is Numberic, and I noticed if I just display ArrMatID(0) it give me '196'
as the value (with the single quotes). How can I get rid of the single
quotes, or a better question, why is the Array putting single quotes around
the ID?
Thanks,
Dean
"Mikhail Berlyant" <berl...@yahoo-inc.com> wrote in message
news:<#BsNqauxBHA.492@tkmsftngp02>...
> BTW, what is the datatype of MatID?
>
> Mikhail Berlyant
> Data Integrator, Yahoo!Music www.yahoo.com
> Brainbench MVP for Visual Basic www.brainbench.com
>
> "Dean Bolton" <de...@vdubn.com> wrote in message
> news:a6b8bh$6...@dispatch.concentric.net...
"Dean Bolton" <de...@vdubn.com> wrote in message
news:a6b8bh$6...@dispatch.concentric.net...
What happens when you response.write the SQL statement directly to the
screen, instead of executing it? This seems to be a more direct approach at
debugging than going to Profiler and assuming that something else is putting
quotes in there arbitrarily.
"Dean Bolton" <de...@vdubn.com> wrote in message
news:a6bb7u$6...@dispatch.concentric.net...
I checked, I am pulling from the Array, any idea why it would add quotes? I
am using it after doing a Split function that looks like this:
ArrMatID = Split(request.form("Attach"),", ")
Is there anything in the Split function that could be causing this?
Thanks,
Dean
"Aaron Bertrand [MVP]" <aaronATaspfaq.com> wrote in message
news:uDgSL8uxBHA.2716@tkmsftngp04...
Mikhail Berlyant
Data Integrator, Yahoo!Music www.yahoo.com
Brainbench MVP for Visual Basic www.brainbench.com
"Dean Bolton" <de...@vdubn.com> wrote in message
news:a6bdna$6...@dispatch.concentric.net...
"Mikhail Berlyant" <berl...@yahoo-inc.com> wrote in message
news:Og0Cx6uxBHA.1340@tkmsftngp05...
Thanks,
Dean
"Mikhail Berlyant" <berl...@yahoo-inc.com> wrote in message
news:uHt9gDvxBHA.2324@tkmsftngp03...
NO, split() does not add single quotes for fun. Observe the following:
response.Write request.form("Attach")
You likely have something wrong with your <input type=text> or whatever is
passing the comma-separated list, e.g.
<input type=checkbox value="'106'">