G
Guest
I am having problems getting this code below to work. I am not why this is
happening, I am a novice programmer and this is the first big project I've
done. So the problem is when I execute the following sql statement I get a
eof/bof error and it only occurs when the value of the column Team has a
space in it ie(The Team)
all relevant code: -
-------------------------------------------------------
strteam = Request.Form("form_team")
CheckTeamsSQL = "Select * from tblteams WHERE TeamMembers ='" & strusername
& "'"
Set rsCheckTeam = dbConn.Execute(CheckTeamsSQL)
If rsCheckTeam.eof Then
' this is when the error comes up. only when strteam contains a name with
spaces
TeamInfoSQL = "Select * from tblteams WHERE Captain = True and Team ='"&
strteam &"'"
set rsTeamInfo = dbConn.Execute(TeamInfoSQL)
strmotto = rsTeamInfo.fields("Motto")
rs.Fields("Motto") = strmotto
-------------------------------------------------
and the value from the form is a list menu generated dynamically so the
value is always whats in the database.
So I guess what I need help with is why I cant have spaces, I believe
that I have had fields with spaces before and it worked. and if I cant have
spaces how would you convert spaces into something else to put into the
database and then still display the correct names with spaces. Thanks for any
help
happening, I am a novice programmer and this is the first big project I've
done. So the problem is when I execute the following sql statement I get a
eof/bof error and it only occurs when the value of the column Team has a
space in it ie(The Team)
all relevant code: -
-------------------------------------------------------
strteam = Request.Form("form_team")
CheckTeamsSQL = "Select * from tblteams WHERE TeamMembers ='" & strusername
& "'"
Set rsCheckTeam = dbConn.Execute(CheckTeamsSQL)
If rsCheckTeam.eof Then
' this is when the error comes up. only when strteam contains a name with
spaces
TeamInfoSQL = "Select * from tblteams WHERE Captain = True and Team ='"&
strteam &"'"
set rsTeamInfo = dbConn.Execute(TeamInfoSQL)
strmotto = rsTeamInfo.fields("Motto")
rs.Fields("Motto") = strmotto
-------------------------------------------------
and the value from the form is a list menu generated dynamically so the
value is always whats in the database.
So I guess what I need help with is why I cant have spaces, I believe
that I have had fields with spaces before and it worked. and if I cant have
spaces how would you convert spaces into something else to put into the
database and then still display the correct names with spaces. Thanks for any
help