Print Page | Close Window

What the hell is wrong with this code??

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=868
Printed Date: 29 March 2026 at 3:40pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: What the hell is wrong with this code??
Posted By: fernan82
Subject: What the hell is wrong with this code??
Date Posted: 09 March 2003 at 12:58pm

I'm doing this for practice as I'm trying to learn ASP, here's the code:

<%
Dim adoConInfo    
Dim strConInfo   
Dim rsCommonInfo
Dim strSQLInfo  
Dim intPlayerID
Dim strPlayerName
Dim strTeam
Dim strPosition
Dim strMore
Dim strPhoto

intPlayerID = CLng(Request.QueryString("Player"))

Set adoConInfo = Server.CreateObject("ADODB.Connection")

strConInfo = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=d:\http root\test\db1.mdb"

adoConInfo.connectionstring = strConInfo

adoConInfo.Open

Set rsCommonInfo = Server.CreateObject("ADODB.Recordset")

strSQLInfo = "SELECT tlbProfile.Player_Name, tblProfile.Team, tblProfile.Position, tblProfile.More, tblProfile.Photo "
strSQLInfo = strSQLInfo & "FROM tblProfile WHERE tblProfile.PlayerID = " & intPlayerID & ""

rsCommonInfo.Open strSQLInfo, adoConInfo

If NOT rsCommonInfo.EOF Then

strPlayerName = rsCommonInfo("Player_Name")
StrTeam = rsCommonInfo("Team")
StrPosition = rsCommonInfo("Position")
strMore = rsCommonInfo("More")
strPhoto = rsCommonInfo("Photo")

End If

rsCommonInfo.Close

%>

and here's the error i'm getting:

  • Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
    [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
    /test/profile.asp, line 28




  • Replies:
    Posted By: turdfurgeson
    Date Posted: 09 March 2003 at 2:05pm

    Change the following to:

    rsCommonInfo.Open strSQLInfo, adoConInfo , 1, 2

    See if that works or not.



    Posted By: fernan82
    Date Posted: 09 March 2003 at 2:08pm

    It don't, i keep getting the same error



    Posted By: faubo
    Date Posted: 09 March 2003 at 2:23pm

    Maybe...

    strSQLInfo = "SELECT tlbProfile.*"

    strSQLInfo = strSQLInfo & "FROM tblProfile WHERE tblProfile.PlayerID = " & intPlayerID & ""

    Right now you are looking for an ID in a field you didn't select.



    -------------
    http://www.conhecerparaconservar.org - I don't know how to make you click here


    Posted By: fernan82
    Date Posted: 09 March 2003 at 2:36pm

    Tried that before and get this error:

  • Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine does not recognize 'tlbProfile.*' as a valid field name or expression.
    /test/profile.asp, line 28

    <edit> i've tried selecting PlayerID too still got the same error...



  • Posted By: fernan82
    Date Posted: 09 March 2003 at 2:48pm
    Got it! it was a typo i had selected tlb_Profile.PlayerName instead of tblProfile.Player_Name


    Posted By: faubo
    Date Posted: 09 March 2003 at 3:31pm

    these kind of thing are very annoying



    -------------
    http://www.conhecerparaconservar.org - I don't know how to make you click here


    Posted By: Gullanian
    Date Posted: 09 March 2003 at 4:44pm
    Check borgs common database errors in ASP section, it would of saved you a lot of time



    Print Page | Close Window

    Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
    Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net