Functions
am 06.02.2005 22:53:56 von Paul Smith
Why does the first function work without a problem, but the second one does
not?
I cannot for the life of me see the difference!!!!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function GetTeamID(PlayerNo)
Set RSF = Server.CreateObject("ADODB.RecordSet")
RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
GetTeamID = RSF("TeamID")
RSF.Close
Set RSF = nothing
End Function
Function GetPlayerName(PlayerNo)
Set RSF = Server.CreateObject("ADODB.RecordSet")
RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
'------------------ Line 38
GetPlayerName = RSF("PlayerFirstName") & " " & RSF("PlayerSecondName") &
" -- " & RSF("TeamName")
RSF.Close
Set RSF = nothing
End Function
Error:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/CricketersDarts/db.asp, line 38
Re: Functions
am 06.02.2005 23:09:49 von Steven Burn
Whats on line 38?
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
"Paul Smith" wrote in message
news:420691f2$0$7933$ed2619ec@ptn-nntp-reader01.plus.net...
> Why does the first function work without a problem, but the second one
does
> not?
>
> I cannot for the life of me see the difference!!!!!
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Function GetTeamID(PlayerNo)
> Set RSF = Server.CreateObject("ADODB.RecordSet")
> RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
> GetTeamID = RSF("TeamID")
> RSF.Close
> Set RSF = nothing
> End Function
>
>
> Function GetPlayerName(PlayerNo)
> Set RSF = Server.CreateObject("ADODB.RecordSet")
> RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
> '------------------ Line 38
> GetPlayerName = RSF("PlayerFirstName") & " " & RSF("PlayerSecondName") &
> " -- " & RSF("TeamName")
> RSF.Close
> Set RSF = nothing
> End Function
>
> Error:
> ADODB.Recordset (0x800A0BB9)
> Arguments are of the wrong type, are out of acceptable range, or are in
> conflict with one another.
> /CricketersDarts/db.asp, line 38
>
>
>
>
Re: Functions
am 07.02.2005 00:10:10 von Paul Smith
Line 38 is the line above,, text wrapping caused the break:
RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
"Steven Burn" wrote in message
news:eOX6$iJDFHA.2676@TK2MSFTNGP12.phx.gbl...
> Whats on line 38?
>
> --
> Regards
>
> Steven Burn
> Ur I.T. Mate Group
> www.it-mate.co.uk
>
> Keeping it FREE!
>
> "Paul Smith" wrote in message
> news:420691f2$0$7933$ed2619ec@ptn-nntp-reader01.plus.net...
>> Why does the first function work without a problem, but the second one
> does
>> not?
>>
>> I cannot for the life of me see the difference!!!!!
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Function GetTeamID(PlayerNo)
>> Set RSF = Server.CreateObject("ADODB.RecordSet")
>> RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
>> GetTeamID = RSF("TeamID")
>> RSF.Close
>> Set RSF = nothing
>> End Function
>>
>>
>> Function GetPlayerName(PlayerNo)
>> Set RSF = Server.CreateObject("ADODB.RecordSet")
>> RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
>> '------------------ Line 38
>> GetPlayerName = RSF("PlayerFirstName") & " " & RSF("PlayerSecondName") &
>> " -- " & RSF("TeamName")
>> RSF.Close
>> Set RSF = nothing
>> End Function
>>
>> Error:
>> ADODB.Recordset (0x800A0BB9)
>> Arguments are of the wrong type, are out of acceptable range, or are in
>> conflict with one another.
>> /CricketersDarts/db.asp, line 38
>>
>>
>>
>>
>
>
Re: Functions
am 07.02.2005 01:29:28 von Steven Burn
Okie, try changing;
RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
To;
RSF.Open "Select PlayerID, PlayerFirstName, PlayerSecondName, TeamName from
tPlayers Where PlayerID = " & Clng(PlayerNo), DB
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
"Paul Smith" wrote in message
news:4206a3d2$0$7907$ed2619ec@ptn-nntp-reader01.plus.net...
> Line 38 is the line above,, text wrapping caused the break:
>
> RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
>
>
> "Steven Burn" wrote in message
> news:eOX6$iJDFHA.2676@TK2MSFTNGP12.phx.gbl...
> > Whats on line 38?
> >
> > --
> > Regards
> >
> > Steven Burn
> > Ur I.T. Mate Group
> > www.it-mate.co.uk
> >
> > Keeping it FREE!
> >
> > "Paul Smith" wrote in message
> > news:420691f2$0$7933$ed2619ec@ptn-nntp-reader01.plus.net...
> >> Why does the first function work without a problem, but the second one
> > does
> >> not?
> >>
> >> I cannot for the life of me see the difference!!!!!
> >>
> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>
> >> Function GetTeamID(PlayerNo)
> >> Set RSF = Server.CreateObject("ADODB.RecordSet")
> >> RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
> >> GetTeamID = RSF("TeamID")
> >> RSF.Close
> >> Set RSF = nothing
> >> End Function
> >>
> >>
> >> Function GetPlayerName(PlayerNo)
> >> Set RSF = Server.CreateObject("ADODB.RecordSet")
> >> RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
> >> '------------------ Line 38
> >> GetPlayerName = RSF("PlayerFirstName") & " " & RSF("PlayerSecondName")
&
> >> " -- " & RSF("TeamName")
> >> RSF.Close
> >> Set RSF = nothing
> >> End Function
> >>
> >> Error:
> >> ADODB.Recordset (0x800A0BB9)
> >> Arguments are of the wrong type, are out of acceptable range, or are in
> >> conflict with one another.
> >> /CricketersDarts/db.asp, line 38
> >>
> >>
> >>
> >>
> >
> >
>
>
Re: Functions
am 07.02.2005 01:31:29 von Tomas Eklund
Could it be the value of PlayerNo that messes things up? The error might be
where the function is called, not in the function body itself.
Re: Functions
am 07.02.2005 12:47:06 von reb01501
Paul Smith wrote:
> Why does the first function work without a problem, but the second
> one does not?
>
> I cannot for the life of me see the difference!!!!!
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Function GetTeamID(PlayerNo)
> Set RSF = Server.CreateObject("ADODB.RecordSet")
> RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
> GetTeamID = RSF("TeamID")
> RSF.Close
> Set RSF = nothing
> End Function
>
>
> Function GetPlayerName(PlayerNo)
> Set RSF = Server.CreateObject("ADODB.RecordSet")
> RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB
> '------------------ Line 38
> GetPlayerName = RSF("PlayerFirstName") & " " &
> RSF("PlayerSecondName") & " -- " & RSF("TeamName")
> RSF.Close
> Set RSF = nothing
> End Function
>
> Error:
> ADODB.Recordset (0x800A0BB9)
> Arguments are of the wrong type, are out of acceptable range, or are
> in conflict with one another.
> /CricketersDarts/db.asp, line 38
It looks to me as if DB is not defined in the second function. I would need
to see the functions in context. Put together a short page with just the
code needed to reproduce the error - no html or anything else to get in the
way. Then show us that, if doing so does not enable you to see the problem
for yourself.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
asdf
am 09.02.2007 18:49:33 von Robert Faulkner
try to put this..
RSF.Open "Select * from tPlayers Where PlayerID = " & PlayerNo, DB,3,3
From http://sg.search.yahoo.com/search?ei=utf-8&fr=slv1-msgr&p=AD ODB.Recordset (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com