help on ASP

B

Bruno Alexandre

Hi guys,

First, my apologies, but I can't find a MS newsgroup for ASP and not
ASP.NET like this one

But here is my question


Set cnData = server.createObject("ADODB.Command")
Set rsData = server.createObject("ADODB.RecordSet")
' set the page size
rsData.PageSize = iPSize
rsData.CursorLocation = adUseClient

' open the data
sSQL = " SELECT * FROM vATSlistaAssistencias " & _
" WHERE estado = 'ACTIVO' and estadoEsc not in ('FORA SERVICO', 'NAO
QUER', 'NAO TEM MAQUINA', 'OUTRA 2') and " & _
" idDistribuidorAssistencia = @idDistAss and localidade like @localidade
" & _
" ORDER BY @coluna @ordem"

with cnData
.ActiveConnection = sConnCW
.CommandText = sSQL
.CommandType = adCmdText

.Parameters.Append = .CreateParameter("@idDistAss", adInteger,
adParamInput)
.Parameters.Append = .CreateParameter("@localidade", adVarChar,
adParamInput, 100)
.Parameters.Append = .CreateParameter("@coluna", adVarChar, adParamInput,
100)
.Parameters.Append = .CreateParameter("@ordem", adVarChar, adParamInput,
5)

.Parameters("@idDistAss") = idDistAssistencia
.Parameters("@localidade") = sLocalidade
.Parameters("@coluna") = sColuna
.Parameters("@ordem") = sOrdem

end with

set rsData = cnData.execute
cnData.ActiveConnection.Close


I got an Error regarding the @idDistAss is not define in the query

[Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable
'@idDistAss'

But, as you can see, I have it defined in the sSQL variable...

What can I do? I'm really stuck here, please help me

--

Bruno Miguel Alexandre
Dep Informática do Grupo Filtrarte

Av General Humberto Delgado, 91
Vila Verde
2705-887 Terrugem SNT
Portugal

T. +351 219 608 130
F. +351 219 615 369
w. www.filtrarte.com
@. (e-mail address removed)
 
K

Kevin Spencer

microsoft.public.inetserver.asp.general
microsoft.public.inetserver.asp.db

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top