Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaration Expected Error

Status
Not open for further replies.

kliz0328

Programmer
Nov 7, 2005
138
0
0
US
I am getting a declaration Expected error on my connection string I don't know what it could possibly be?
Code:
<Script Runat="Server">
Dim Conn
Dim SQL
Dim dbcomm, dbreader
Dim Headers as String

Conn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("datas/Wiffle.mdb"))
Conn.Open()
Select Case UCase(Request.QueryString("type"))
  Case "HR"
    SQL="SELECT PlayerInfo.*, Statistics.* FROM PlayerInfo INNER JOIN Statistics ON PlayerInfo.PlayerID = Statistics.PlayerID Order By HR DESC, LastName, FirstName, Hits, AtBats, Pic, Song, HittingDesc, FieldingDesc, Description, Statistics.PlayerID, PlayerInfo.PlayerID, [Pitching K's] "
    Headers="Home Run Leaders"
  Case "BA"
          SQL="SELECT PlayerInfo.*, Statistics.* FROM PlayerInfo INNER JOIN Statistics ON PlayerInfo.PlayerID = Statistics.PlayerID Order By  [Hits]/[AtBats] DESC, Hits, LastName, FirstName, AtBats, HR, Pic, Song, HittingDesc, FieldingDesc, Description, Statistics.PlayerID, PlayerInfo.PlayerID, [Pitching K's] "
    Headers="Batting Average Leaders"
  Case "SO"
          SQL="SELECT PlayerInfo.*, Statistics.* FROM PlayerInfo INNER JOIN Statistics ON PlayerInfo.PlayerID = Statistics.PlayerID Order By  [Pitching K's] DESC, LastName, FirstName, Hits, AtBats, HR, Pic, Song, HittingDesc, FieldingDesc, Description, Statistics.PlayerID, PlayerInfo.PlayerID"
    Headers="Strike Out Leaders"
  Case Else
          SQL="SELECT PlayerInfo.*, Statistics.* FROM PlayerInfo INNER JOIN Statistics ON PlayerInfo.PlayerID = Statistics.PlayerID Order By  HR, LastName, FirstName, Hits, AtBats, Pic, Song, HittingDesc, FieldingDesc, Description, Statistics.PlayerID, PlayerInfo.PlayerID, [Pitching K's] "
    Headers="Home Run Leaders"
End Select

dbcomm= New OleDbCommand(SQL,Conn)
dbreader=dbcomm.ExecuteReader()
players.DataSource=dbreader
players.DataBind()
dbreader.Close()
Conn.Close()
 
Well, you haven't declared any of your variables to a particular type. Fix that first and then post back if you still have problems.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I declared the types of the variables and am still getting the same message.
 
Nevermind I forgot the Sub Page_Load declaration like an idiot my apologies
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top