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)
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)