Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 20th, 2011, 03:13 PM
Registered User
 
Join Date: Jun 2011
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
Exclamation database problem - could use some help

i'm trying to put an old asp 3.0 database driven plants (with 600+) website back online that i built 6+ years ago. good luck remembering code that old!

the strange thing is that this site was working great for 2 years when it was online. all i did was remove it and store on my personal machine with everything intact. please take a look, anyone and let me know what you think it is. thanks!!

this is the error msg:
----------------------

Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

/index.asp, line 31

================================================== =======

this is index.asp from the top line to the closing head tag.
------------------------------------------------------------

Code:
<!-- #INCLUDE FILE="content.asp" -->
<!doctype html public "-//w3C//dtd html 4.0 transitional//en">
<html><head><title>Successful Houseplants - growing and buying tips</title>
<meta name="description" content="Be successful with plants! Read interesting facts, buying and 'Plant Doctor' tips 
for many exciting plants. Also has links to nurseries to buy plants, books, and supplies." />
<meta name="keywords" content="" />
<link rel="stylesheet" href="plants.css" type="text/css" />
 
<%
  Response.Expires = 60 
  Response.ExpiresAbsolute = Now() - 1 
  Response.AddHeader "pragma","no-cache" 
  Response.AddHeader "cache-control","private" 
  Response.CacheControl = "no-cache" 

  if Session("Logout") <> "yes" then
    if Request.Cookies("SavedLogin").haskeys then
      Session("PersonID")=Request.Cookies("SavedLogin")("personid")
      Session("Username")=Request.Cookies("SavedLogin")("username")
      Session("Password")=Request.Cookies("SavedLogin")("pw")
      Session("blnValidUser") = true
    end if
  end if

  set objConn = Server.CreateObject("ADODB.Connection")
  objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
  
  set rsIntro = Server.CreateObject("ADODB.Recordset")
  strSQL = "SELECT count(*) as plantcnt FROM intro " & _
           "WHERE ready=true and Instr(common_name, '1')=0 and group_nbr<17 "
***************** line 31 below throws the error ****************

Code:
rsIntro.Open strSQL, objConn
************************************************** *****

Code:
  if not rsIntro.EOF then
    dim intTotPlants
    intTotPlants=rsIntro("plantcnt")
  end if
  rsIntro.Close
  strSQL = "SELECT count(*) as tipscnt FROM intro WHERE ready=true and Instr(common_name, '1')=1 or group_nbr>16"
  rsIntro.Open strSQL, objConn
  if not rsIntro.EOF then
    dim int
    intTotTips=rsIntro("tipscnt")
  end if

  set rsIntro = nothing
  set objConn = nothing
%>
================================================== ====

i declare these and more in content.asp (the include file)
----------------------------------------------------------

Code:
  dim filePath, objConn
  filePath = Server.MapPath("\db\plants.mdb") 
 
  dim filePath2, objConn2
  filePath2 = Server.MapPath("\db\promotions.mdb")

  dim filePath3, objConn3
  filePath3 = Server.MapPath("\db\vars.mdb")

  dim strSQL
  strSQL=""
================================================== =====

let me know if you need to see the fields in the "intro" table...
 
Old August 22nd, 2011, 06:25 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

See if you can solve this error using this info:

http://www.adopenstatic.com/faq/80040e10.asp
The Following User Says Thank You to rstelma For This Useful Post:
4Wheels (August 25th, 2011)
 
Old August 24th, 2011, 03:35 AM
Authorized User
 
Join Date: Jan 2011
Posts: 86
Thanks: 1
Thanked 12 Times in 12 Posts
Default

Hi 4Wheels,


looks like either common_name or group_nbr is empty or null.

The parameters are probably declared and initialised in content.asp, aren't they?
Best approach to debug this is to add some debug output in index.asp before line 31
Code:
response.write "<br>common_name: " & common_name
response.write "<br>group_nbr: " & group_nbr
response.flush
response.end
Or alternatively look at the entire sql statement (again to be added right before line 31):
Code:
response.write strSQL 
response.flush
response.end


Hope this helps.

Last edited by disel2010; August 24th, 2011 at 03:37 AM..
The Following User Says Thank You to disel2010 For This Useful Post:
4Wheels (August 25th, 2011)
 
Old August 24th, 2011, 10:24 PM
Registered User
 
Join Date: Jun 2011
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
Default database problem

disel2010,

you're absolutely right! common_name and group_nbr are both null. the database has values there so i'm wondering if it's really connecting. i'll investigate further after checking the link in the first link... and then report back.

thanks!
 
Old August 27th, 2011, 09:15 PM
Registered User
 
Join Date: Jun 2011
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
Exclamation my first thought too

Quote:
Originally Posted by rstelma View Post
See if you can solve this error using this info:

http://www.adopenstatic.com/faq/80040e10.asp
I had done a search on "Microsoft JET Database Engine (0x80040e10)" and read some info like the info at that link. But the script used to work and wasn't changed. Just to check the select statement I wrote out the string created and it's fine: SELECT count(*) as plantcnt FROM intro WHERE ready=true and Instr(common_name, '1')=0 and group_nbr<17

I'm not sure if it's connecting to the database. Any other ideas?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database problem Fed BOOK: ASP.NET 3.5 Website Programming Problem Design Solution 5 August 28th, 2011 09:08 AM
Problem to restore database in C#2005 database acmuralee MySQL 0 March 25th, 2008 04:42 AM
DATABASE PROBLEM. PLEASE HELP! dextergaisie Crystal Reports 2 May 15th, 2007 05:58 AM
database problem shazia1 VS.NET 2002/2003 2 June 11th, 2006 05:46 AM
database problem rahul8346 SQL Server 2000 1 May 16th, 2006 11:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.