p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Databases (http://p2p.wrox.com/forumdisplay.php?f=62)
-   -   database problem - could use some help (http://p2p.wrox.com/showthread.php?t=84793)

4Wheels August 20th, 2011 03:13 PM

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...

rstelma August 22nd, 2011 06:25 PM

See if you can solve this error using this info:

http://www.adopenstatic.com/faq/80040e10.asp

disel2010 August 24th, 2011 03:35 AM

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.

4Wheels August 24th, 2011 10:24 PM

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!

4Wheels August 27th, 2011 09:15 PM

my first thought too
 
Quote:

Originally Posted by rstelma (Post 275735)
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?


All times are GMT -4. The time now is 12:40 PM.

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