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 September 8th, 2003, 02:27 PM
Authorized User
 
Join Date: Sep 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to TnTandyO Send a message via Yahoo to TnTandyO
Default Display a single record.. PLEASE HELP

ok guys this may seem simple... but... here goes
I have an asp page that display a certin list of records, then I want to be able to click on record and go to that record only..(hope that makes sense). here is my code on first page:(seems to work)

"<form name=" & objRS("id") & " method= post action=Display.asp>" & _
    "<input type=hidden name=id value=" & objRS("id") & ">" & _
    "<input type=image src=images/" & objRS("solved") & ".gif></form>" & "</TD>" & _

Then it goes to:(this is all on one line-- yes I got lazy)

strSQL = "SELECT [id], [solved], [comment], [Fname], [Lname], [dept], [email], [phone], [repet], [tech], [notes], [date], [time], [priority] FROM [tblIThelp] WHERE [ID] =" & intID

And here is my error.. (notice the post data)
Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/asp/rod/Display.asp, line 44


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts; Hotbar 4.3.1.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)

Page:
POST 13 bytes to /asp/rod/Display.asp

POST Data:
id=28&x=8&y=9
OK I know that this is the right rec num. BUT where could [&x=8&y=9] come from????
 
Old September 8th, 2003, 02:59 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

The x and y Request variables are the location of the image where you clicked when you submitted the form. Since you are using an image to submit the page (input type="image") the browser sends the x and y coordinates as well. This is the way to create server side image maps (they are a bit old fashioned now since most browsers implement client side image maps as well).

The error most likely occurred because intID does not have a value. You can check this by writing out your strSQL statement right before you send it to the database using Response.Write(strSQL)

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 8th, 2003, 04:49 PM
Authorized User
 
Join Date: Sep 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to TnTandyO Send a message via Yahoo to TnTandyO
Default

Hi Imar,
Well, you were right intID does not appear to have a value. My question now would be why not? The form is passing it to next page, here is more of my code:

Dim Connection,connStatus,objRS,strSQL,intID

intID = Request.Form("id")

SET Connection = Server.CreateObject("ADODB.Connection")
Connection.Open strStatus


strSQL = "SELECT [id], [solved], [comment], [Fname], [Lname], [dept], [email], [phone], [repet], [tech], [notes], [date], [time], [priority] FROM [tblIThelp] WHERE [ID] =" & intID


Set objRS=Connection.Execute(strSQL)
Response.Write "<center>"
Response.Write "<TABLE width=100% Border=1 cellspacing=1>" & "<TR><TD colspan=6

SOME TABLES and..

Do Until objRS.EOF
 
Old September 8th, 2003, 04:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am not sure but... could it be that 'id' is some keyword!?

Jacob.
 
Old September 8th, 2003, 05:00 PM
Authorized User
 
Join Date: Sep 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to TnTandyO Send a message via Yahoo to TnTandyO
Default

Hi Jacob,
I'm not sure what you are asking, but 'id' is my database record number. Are you thinking it could be some kind of command?
Thanks for any help,
Tandy
 
Old September 8th, 2003, 05:00 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If you look at the source of the first page, is the ID field present between the <form> tags?

Do you have just one form on the page?

If this doesn't help, please post the entire code, or better yet, link to some text files that contain the source (with any private info removed....)

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 8th, 2003, 05:03 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Jacob could be right. Because you haven't enclosed the name attribute's value in quotes, the browser may think that ID is the ID attribute of the <input> tag, and not the value of the name attribute.

Try this:
Code:
"<input type=""hidden"" name=""id""
or better yet:
Code:
"<input type=""hidden"" name=""txtID""

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 8th, 2003, 05:06 PM
Authorized User
 
Join Date: Sep 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to TnTandyO Send a message via Yahoo to TnTandyO
Default

OK this is this the code I see from the browser:
<form name=28 method= post action=Display.asp>
<input type=hidden name=id value=28><input type=image src=images/open.gif></form>

So unless I'm missunderstanding you the answer is yes???
So confused,
Tandy
 
Old September 8th, 2003, 05:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hehe! Imar... I was just writing that... I even think that you could write like this.

"<input type='hidden' name='id' value='" & objRS("id") & "'>"

Jacob.
 
Old September 8th, 2003, 05:08 PM
Authorized User
 
Join Date: Sep 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to TnTandyO Send a message via Yahoo to TnTandyO
Default

ok got cha... but remember my asp code is like this:
"<TD valign=top>" & "<form name=" & objRS("id") & " method= post action=Display.asp>" & _
    "<input type=hidden name=id value=" & objRS("id") & ">" & _
    "<input type=image src=images/" & objRS("solved") & ".gif></form>" & "</TD>" & _





Similar Threads
Thread Thread Starter Forum Replies Last Post
Repeat single record in Crystal Report? jpryor Crystal Reports 1 April 11th, 2008 10:20 AM
Help in appending a single record. prashanthmcr SQL Language 0 December 14th, 2005 08:47 PM
How do I append a single record ??? prashanthmcr SQL Language 3 December 14th, 2005 05:40 PM
Editing SINGLE record in ASP.NET Koofmich ADO.NET 5 December 30th, 2004 05:42 AM
"Single-Record" Recordset Wyatt70 Classic ASP Databases 2 November 18th, 2003 01:20 PM





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