1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

new to asp, banging my head

Discussion in 'C#' started by leicaphotos, Apr 18, 2008.

  1. #1
    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 #:&nbsp;</strong>"
    Response.write Recordset("ProductCode")
    Response.write "<br>" 
    Response.write "<strong>Description:</strong>&nbsp;"
    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):
     
    leicaphotos, Apr 18, 2008 IP
  2. dorwin

    dorwin Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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!
     
    dorwin, Apr 19, 2008 IP
  3. Sleeping Troll

    Sleeping Troll Peon

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Have you set up an odbc source?
    If not do so via administrative tools in control panel.
     
    Sleeping Troll, Apr 20, 2008 IP
  4. Trusted Writer

    Trusted Writer Banned

    Messages:
    1,370
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    160
    #4
    [​IMG] 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 [​IMG]
     
    Trusted Writer, Apr 20, 2008 IP
  5. dylanj

    dylanj Peon

    Messages:
    173
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #5
    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
     
    dylanj, Apr 20, 2008 IP
  6. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #6
    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.
     
    AstarothSolutions, Apr 21, 2008 IP
  7. Czew

    Czew Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    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.. :D).
     
    Czew, Apr 22, 2008 IP
  8. JimBow

    JimBow Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I agree with Czew - go with ADO, much much better!
     
    JimBow, Apr 25, 2008 IP