First time posting here. Been using ASP for about a year but never really got to far into coding. I only learnt enough to get my site up and running as i was on a tight deadline. Im now upgrading the site and need a little help with the "Filte" properties of a RecordSet.
Im trying to group together similar records. Its basically a discography of albums that a band has released. I have been reading the code on chapter 13 page 549 which i could adapt to do what i want it to do but im getting stuck.
Here is the code i have.
<% OPTION EXPLICIT %>
<link rel="stylesheet" href="includes/style.css" type="text/css">
Dim strSQL, ID
' strSQL = "SELECT Albums.AlbumsID, Albums.Album, Lyrics.LyricsID, Lyrics.Title, Lyrics.AlbumsID FROM Albums LEFT JOIN Lyrics ON Albums.AlbumsID=Lyrics.AlbumsID WHERE Lyrics.Active=1;"
strSQL = "SELECT Albums.AlbumsID AS Albums_AlbumsID, Albums.Name AS Albums_Name, Tracks.TracksID, Tracks.AlbumsID AS Tracks_AlbumsID, Tracks.LyricsID, Tracks.TabID, Tracks.Name AS Tracks_Name, Tracks.TrackNumber FROM Albums INNER JOIN Tracks ON Albums.AlbumsID = Tracks.AlbumsID;"
'Open DB connection
'objRS.CursorType = 3
objRS.Open strSQL, objConn, adOpenStatic, AdLockReadOnly, adCmdTable
objRS.Filter = objRS("Albums_Name")
Dim Count 'We'll use this to limit the number of records displayed on a page
Count = 1
Response.Write "<table border=1 cellpadding=0>"
Do While Not objRS.EOF
.Write "<tr class=""body"">"
'.Write "<a href=""LyricsDetailPage.asp?ID=" & objRS("Lyrics.LyricsID") & """> Lyrics</a> "
count = count + 1
'objRS.Filter = nothing
Response.Write "<tr><td align=center>"
'Call BuildNav2 (intPrev,IntNext,TotalPages)
Set objRS = Nothing
When i run the page a i get the following error message.
SELECT Albums.AlbumsID AS Albums_AlbumsID, Albums.Name AS Albums_Name, Tracks.TracksID, Tracks.AlbumsID AS Tracks_AlbumsID, Tracks.LyricsID, Tracks.TabID, Tracks.Name AS Tracks_Name, Tracks.TrackNumber FROM Albums INNER JOIN Tracks ON Albums.AlbumsID = Tracks.AlbumsID;
Microsoft JET Database Engine error '80040e14'
Syntax error in FROM clause.
/beta/lyrics_iframe.asp, line 22
But if i take out the lines "adOpenStatic, AdLockReadOnly, adCmdTable" propertie i get the results printed on the page as expected.
Can someone explain where im going wrong? i've been at this for a few hours and i think i need a fresh pair of eyes.