A friend recommended me to this site as being really helpful so I thought I'd come to you guys with a question in regards to generating a page in ASP that randomly selects an item from a database and displays it on the page. I have all the code working save for the random generation of the ItemID number. Here's what the chunk of code looks like for my SQL query:
strSQL = "SELECT Items.ItemID, Items.ItemName, Items.ItemType, Items.ItemPriceBuy, Vendors.VendorName " & _
"FROM Items INNER JOIN Vendors ON Items.VendorID = Vendors.VendorID " & _
"WHERE ItemID = intItemID;"
And to generate the random number that the variable intItemID is, I've used the following code:
randomize
intItemID = Int(22* rnd(1)) +1
When using the combination of the code, I receive the following error:
Quote:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
../RandomItem.asp, line 25
If anyone has any idea as to how I might fix this issue, it would be greatly appreciated, thanks!