Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 11th, 2003, 10:01 AM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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)


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQLserver 2000 vs SQLserver 2005 Express cJeffreywang BOOK: Beginning ASP.NET 2.0 and Databases 0 April 22nd, 2007 09:52 AM
Upgrading ASP w/ SQLserver 2000 to ASP.NET w/2005 cJeffreywang ASP.NET 2.0 Basics 1 April 5th, 2007 11:30 PM
Not sure-- Sqlserver? ASP.NET? shaileshmark SQL Server 2000 5 August 9th, 2006 08:33 AM
problem in reading imge from sqlserver webphp SQL Server 2000 2 February 7th, 2005 12:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.