problem with asp+sqlserver
i have a little problem with a page in asp...
i need to display a form with or without data depend one variable named 'cod1'.
the source code is:
--- begin
dim Cod1, Cod_Pessoa, Nome, Matricula, Dt_Admissao
dim Cod_Cargo, Cargo, Cod_Setor, Setor, Cod_NivelFuncional, NivelFuncional
dim Salario, ChSemanal, Comissao, Dt_Promocao
dim SQL1, SQL2, SQL3, SQL4, supersql
' Cod1 = Request.QueryString("Cod1")
SQL1 = "SELECT Cod_Pessoa, Matricula, Admissao, "
SQL2 = "Cod_Cargo, Cod_Setor, Cod_NivelFuncional, CHSemanal, Salario, Comissao, UltimaPromocao "
SQL3 = "FROM Funcionarios"
if NOT Isnull(Cod1) then
SQL4 = " WHERE Cod_Pessoa = "& Cod1
end if
supersql = SQL1 & SQL2 & SQL3 & SQL4
set funcionario = Server.CreateObject("ADODB.Recordset")
funcionario.ActiveConnection = Session( "Conexao" )
funcionario.CursorType = 0
funcionario.CursorLocation = 2
funcionario.LockType = 3
'this is line 62!
funcionario.Source = supersql
funcionario.Open()
if funcionario.RecordCount > 0 then
Cod_Pessoa = funcionario.Fields.Item( "Cod_Pessoa" ).Value
Nome = funcionario.Fields.Item("Nome").Value
Matricula = funcionario.Fields.Item("Matricula").Value
Dt_Adminissao = funcionario.Fields.Item("Admissao").Value
Cod_Cargo = funcionario.Fields.Item("Cod_Cargo").Value
Cod_Setor = funcionario.Fields.Item("Cod_Setor").Value
Cod_NivelFuncional = funcionario.Fields.Item("Cod_NivelFuncional").Valu e
Salario = funcionario.Fields.Item("Salario").Value
ChSemanal = funcionario.Fields.Item("ChSemanal").Value
Comissao = funcionario.Fields.Item("Comissao").Value
Dt_Promocao = funcionario.Fields.Item("UltimaPromocao").Value
funcionario.Close()
end if
--- end
but, the asp interpreter return the follow error:
Microsoft OLE DB Provider for SQL Server (0x80040E21)
It does not have support for the requested properties.
/principal/Funcionarios/Funcionario.asp, line 62
which is the problem with the code? it me seems certain...
(ado 2.5, iis 5, windows 2000 advanced server)
|