I am trying to get a database driven thing to work - evidently not doing something right am receiving the following error: icrosoft JET Database Engine error '80040e10' No value given for one or more required parameters. /occaision.asp, line 41 any thoughts? <% 'declare the variable that will hold new connection object Dim Connection 'create an ADO connection object Set Connection=Server.CreateObject("ADODB.Connection") 'declare the variable that will hold the connection string Dim ConnectionString 'define connection string, specify database driver and location of the database ConnectionString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source= d:\fcpromotionshome\fcp\fcpromotions.mdb" 'open the connection to the database Connection.Open ConnectionString %> [COLOR="Red"]<% 'declare the variable that will hold our new object Dim Recordset 'create an ADO recordset object Set Recordset=Server.CreateObject("ADODB.Recordset") [/COLOR] 'declare the variable that will hold the SQL statement Dim SQL SQL="SELECT * FROM fcpromotions WHERE Active = TRUE AND Category = AllOccaision" 'Open the recordset object executing the SQL statement and return records Recordset.Open SQL, Connection %> <% 'first of all determine whether there are any records If Recordset.EOF Then Response.Write("No records returned.") Else 'if there are records then loop through the fields Do While NOT Recordset.Eof Response.write "<table width='300' class='fcbody'>" Response.write "<tr><td valign='top' width='100'>" Response.write "<img src='images/" Response.write Recordset("ProductCode") Response.write ".gif' width='90' height='137' alt='" Response.write Recordset("ProductDescription") Response.write "'></td><td width='200' valign='top'><strong>Product #: </strong>" Response.write Recordset("ProductCode") Response.write "<br>" Response.write "<strong>Description:</strong> " Response.write Recordset("ProductDescription") Response.write "</td></tr></table>" Recordset.MoveNext Loop End If %> <% Recordset.Close Set Recordset=Nothing Connection.Close Set Connection=Nothing %> Code (markup):
You might want to change your assigned varibale for recordset. I'm not 100% but I don't think you can use pre defined Terms like Recordset to access your database. Instead of RecordSet why not use Set rcdst = Server.CreateObject("ADODB.Recordset") Try It!
There is a good tutorial explaining common JET engine errors on Windows based servers that you may like to check it out at tutorials.aspfaq.com/8000xxxxx-errors/why-do-i-get-80040e10-errors.html Sorry about the URL but I cannot post live links yet
The first thing about database errors is that they're all a bit whacko, and normally don't actually tell what the exact problem is. I think the problem lies in your SQL statement. Instead of this SQL="SELECT * FROM fcpromotions WHERE Active = TRUE AND Category = AllOccaision" Code (markup): try this SQL="SELECT * FROM fcpromotions WHERE [Active] = TRUE AND [Category] = AllOccaision" Code (markup): You see, I think "Active" and/or "Category" may be reserved words. Also, make sure you have the field types right. For instance, if "Category" is a text field, it will need to have '' as delimiters. Like this: SQL="SELECT * FROM fcpromotions WHERE [Active] = TRUE AND [Category] = 'AllOccaision'" Code (markup): I hope this helps
If you are new to it all then you should also really be looking at learning .Net rather than classic ASP given that it is arguably simpler to learn and certainly more powerful plus classic asp is all but unsupported these days where as ASP.Net is the current technology.
How about this? http://www.w3schools.com/ado/ado_recordset.asp This is ADO connection. It's in superior usage at ASP(or so I think so.. ).