Wednesday, March 7, 2012

Problem with double commas...

hello..im doing some loops that make the variables with ", "..but some
are with double commas..like this:
@.PREFIXO_NOME=1, @.MORADA='rya', @.LOCALIDADE='dad', , @.SEXO='M',
@.OUTROS_DESCRICAO=0, @.CODIGO_POSTAL='1234-223', @.ESTADO_CIVIL=1,
@.AREAS_DESCRICAO=Null, @.PAIS='Portugal', @.NR_CTRB=Null, @.TELEFONE=Null,
,
@.TELEMOVEL=Null
here is the code that i use..:
SQLStmt = "Exec SP_CEL_Input_RegCliente "
control1 = ""
for each name in Request.Form
if count > 0 then
SQLStmt = SQLStmt & ", "
end if
if ((InStr(1,name,"QUAIS_LOJAS")>0) or (InStr(1,name,"ALIMENTACAO")>0)
or (InStr(1,name,"OUTROS")>0) or (InStr(1,name,"SUPLEMENTOS")>0) or
(InStr(1,name,"AREAS_INTERESSE")>0) or
(InStr(1,name,"NEWSLETTER")>0))then
SQLStmt = SQLStmt & "@." & name & "=" & setCkbox(Request.Form(name))
control1 = control1 & name & ", "
else
if (InStr(1,name,"nascedia")>0) then
dia = Request.Form(name)
else
if (InStr(1,name,"nascemes")>0) then
mes = Request.Form(name)
else
if (InStr(1,name,"nasceano")>0) then
ano = Request.Form(name)
else
SQLStmt = SQLStmt & "@." & name & "=" &
setStrNull(Request.Form(name))
end if
end if
end if
end if
count = count + 1
next
SQLStmt = SQLStmt & ", @.DATA_NASCIMENTO="&setDateTime(dia & "/" & mes
& "/" & ano)
Can anybody try to help..?
Thx in advanceStep through the code and find the problem
I would always advise against dynamic SQL
"Pp" <josemariabarros@.gmail.com> wrote in message
news:1149693653.414739.152980@.j55g2000cwa.googlegroups.com...
> hello..im doing some loops that make the variables with ", "..but some
> are with double commas..like this:
> @.PREFIXO_NOME=1, @.MORADA='rya', @.LOCALIDADE='dad', , @.SEXO='M',
> @.OUTROS_DESCRICAO=0, @.CODIGO_POSTAL='1234-223', @.ESTADO_CIVIL=1,
> @.AREAS_DESCRICAO=Null, @.PAIS='Portugal', @.NR_CTRB=Null, @.TELEFONE=Null,
> ,
> @.TELEMOVEL=Null
> here is the code that i use..:
> SQLStmt = "Exec SP_CEL_Input_RegCliente "
> control1 = ""
> for each name in Request.Form
> if count > 0 then
> SQLStmt = SQLStmt & ", "
> end if
> if ((InStr(1,name,"QUAIS_LOJAS")>0) or (InStr(1,name,"ALIMENTACAO")>0)
> or (InStr(1,name,"OUTROS")>0) or (InStr(1,name,"SUPLEMENTOS")>0) or
> (InStr(1,name,"AREAS_INTERESSE")>0) or
> (InStr(1,name,"NEWSLETTER")>0))then
> SQLStmt = SQLStmt & "@." & name & "=" & setCkbox(Request.Form(name))
> control1 = control1 & name & ", "
> else
> if (InStr(1,name,"nascedia")>0) then
> dia = Request.Form(name)
> else
> if (InStr(1,name,"nascemes")>0) then
> mes = Request.Form(name)
> else
> if (InStr(1,name,"nasceano")>0) then
> ano = Request.Form(name)
> else
> SQLStmt = SQLStmt & "@." & name & "=" &
> setStrNull(Request.Form(name))
> end if
> end if
> end if
> end if
> count = count + 1
> next
> SQLStmt = SQLStmt & ", @.DATA_NASCIMENTO="&setDateTime(dia & "/" & mes
> & "/" & ano)
>
> Can anybody try to help..?
> Thx in advance
>

No comments:

Post a Comment