Hi everyone, Im pretty new to asp, so sorry if the solution is obvious. Ok so im trying to create a stored procedure to retrieve information regarding new releases from my database. However I keep getting this error
im grateful for any help, my code follows
Cheers, Tim
Code:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/index.asp, line 5
CREATE PROCEDURE up_GetNewReleasesTop3
im grateful for any help, my code follows
Code:
'index page
<%
<!-- #include file="include\config.asp" -->
CREATE PROCEDURE up_GetNewReleasesTop3
AS
Select Distinct Top 3
tblArtists.ArtistName,
tblProducts.ProductTitle,
tblProducts.releaseDate,
tblProducts.price
From
tblProducts
InnerJoin
tblArtists
ON
tblArtists.artistID = tblProduct.artistID
WHERE
tblProducts.releaseDate <= GetDate()
Order by tblProducts.releaseDate DESC
Go
Function GenerateNewReleases()
Dim HTMLString 'as String
Dim sqlQuery 'as String
Dim rs 'as ADODB.RecordSet
sqlQuery = "up_GetNewReleasesTop3"
Set rs = Server.CreateObject("ADODB.RecordSet")
Set rs = dbConn.Execute(sqlQuery)
If rs.EOF and rs.BOF Then
HTMLString="Sorry, there are no new Releases available for purchase at this time"
Else
Do Whole Not rs.Eof
HTMLString = HTMLString & "<b>" & rs("ArtistName") & "</b> -- "
HTMLString = HTMLString & "<i>" & rs("ProductTitle") & </i> -- "
HTMLString = HTMLString & rs("releaseDate") & " "
HTMLString = HTMLString & rs("price") & vbcrlf
rs.MoveNext
Loop
End IF
Set rs = Nothing
GenerateNewRelease = HTMLString
End Function
%>
<html>
<head>
<Title> Multimedia Warehouse </title>
</head>
<body>
<%
'Declaring String Variables to be used to store output from procedures
Dim newReleaseHTML 'as String
Dim bestSellersHTML 'as String
'procedure results are now stored in variables
newReleaseHTML = GenerateNewReleases()
bestSellersHTML = GeneratebestSellers()
%>
'table is created to diasply the resutls onthe index page
<table width = "99%" cellspacing=5 cellpadding=5 border=0>
<tr>
<td valign="top">
<h1> New Releases </h1>
'displaying contents of variable in current place on page
<%=newReleasesHTML%>
</td>
</tr>
<tr>
<td valign="top">
<h1> Current Best Sellers </h1>
'displaying contents of variable in current place on page
<%=bestSellersHTML%>
</td>
</tr>
</table>