Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - What the hell is wrong with this code??
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

What the hell is wrong with this code??

 Post Reply Post Reply
Author
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Topic: What the hell is wrong with this code??
    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

  • Back to Top
    turdfurgeson View Drop Down
    Newbie
    Newbie
    Avatar

    Joined: 25 September 2002
    Location: United States
    Status: Offline
    Points: 29
    Post Options Post Options   Thanks (0) Thanks(0)   Quote turdfurgeson Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2003 at 2:05pm

    Change the following to:

    rsCommonInfo.Open strSQLInfo, adoConInfo , 1, 2

    See if that works or not.

    Back to Top
    fernan82 View Drop Down
    Mod Builder Group
    Mod Builder Group
    Avatar

    Joined: 17 November 2002
    Location: United States
    Status: Offline
    Points: 362
    Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2003 at 2:08pm

    It don't, i keep getting the same error

    Back to Top
    faubo View Drop Down
    Senior Member
    Senior Member
    Avatar

    Joined: 30 May 2002
    Location: Brazil
    Status: Offline
    Points: 560
    Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post 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.

    Back to Top
    fernan82 View Drop Down
    Mod Builder Group
    Mod Builder Group
    Avatar

    Joined: 17 November 2002
    Location: United States
    Status: Offline
    Points: 362
    Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post 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...



  • Edited by fernan82
    Back to Top
    fernan82 View Drop Down
    Mod Builder Group
    Mod Builder Group
    Avatar

    Joined: 17 November 2002
    Location: United States
    Status: Offline
    Points: 362
    Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2003 at 2:48pm
    Got it! it was a typo i had selected tlb_Profile.PlayerName instead of tblProfile.Player_Name
    Back to Top
    faubo View Drop Down
    Senior Member
    Senior Member
    Avatar

    Joined: 30 May 2002
    Location: Brazil
    Status: Offline
    Points: 560
    Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2003 at 3:31pm

    these kind of thing are very annoying

    Back to Top
    Gullanian View Drop Down
    Senior Member
    Senior Member
    Avatar

    Joined: 04 January 2002
    Location: England
    Status: Offline
    Points: 4373
    Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2003 at 4:44pm
    Check borgs common database errors in ASP section, it would of saved you a lot of time
    Back to Top
     Post Reply Post Reply

    Forum Jump Forum Permissions View Drop Down

    Forum Software by Web Wiz Forums® version 12.08
    Copyright ©2001-2026 Web Wiz Ltd.


    Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
    About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

    Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
    Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

    Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

    Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.