Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old September 8th, 2003, 05:14 PM
Authorized User
 
Join Date: Sep 2003
Location: Waco, TX, .
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

Sorry didnt read that well... but I tried it both ways with no results... still get the same message..
No value given for one or more required parameters.
Reply With Quote
  #12 (permalink)  
Old September 8th, 2003, 05:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Strange... have you tried your SQL directly in the database!? Thats worth a try.

Instead of applying all the column names of your table you could try to do this...

strSQL = "SELECT * FROM [tblIThelp] WHERE [ID] =" & intID

Have you tried to hardcode a value for the intID? and made sure that this IS infact the problem?

Jacob.
Reply With Quote
  #13 (permalink)  
Old September 8th, 2003, 06:51 PM
Authorized User
 
Join Date: Sep 2003
Location: Waco, TX, .
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

Sorry guys had to step out... Ok tried to do a search using and number that I knoew was in my data base, and got this error:
strSQL = "SELECT * FROM tblIThelp WHERE ID ='28'"
Same line:
Data type mismatch in criteria expression.
Reply With Quote
  #14 (permalink)  
Old September 8th, 2003, 07:11 PM
Authorized User
 
Join Date: Sep 2003
Location: Waco, TX, .
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

I got this to work like this:
strSQL = "SELECT * FROM tblIThelp WHERE ID = 28 "

but then when I do this:
strSQL = "SELECT * FROM tblIThelp WHERE ID = intID "

and add this:
Dim intID
intID = Request.Form("ID")

it breaks... grrrr.. am I missing some thing here?
Same old error:
No value given for one or more required parameters.
PLEASE don't give up on me... I'm so close!
Thanks,
Tandy
Reply With Quote
  #15 (permalink)  
Old September 8th, 2003, 08:19 PM
Authorized User
 
Join Date: Sep 2003
Location: Waco, TX, .
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 guys I guess I'm going to start a new topic... I figured this one out... just incase you want to know..
it has some thing to do with my database ID field, it is set to auto number, when I change this to text it works just fine.. great but.. I need it to Auto number when a new rec is added.. Thanks for all the help! You two were wonderful.
Tandy
Reply With Quote
  #16 (permalink)  
Old September 9th, 2003, 01:41 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi TnTandyO,

In addition to all this, I think you're making it pretty hard for your self. If all you need to do is pass a single ID from one page to another by clicking an image, why no try this:

[ASP Code]
Code:
<%
  ' Some code that creates your recordset
    intID = objRS("id")
    sImageName = objRS("solved")
%>
[Plain HTML here]
Code:
<a href="Display.asp?ID=<%=intID%>"><img src="images/<%=sImageName%>"></a>
This will insert an image that links to the next page, passing the ID from the recordset in the QueryString.

In Display.asp, you can simply use:

<%
  Dim intID
  intID = Request.QueryString("ID")
  If Len(intID) > 0 Then
    ' ID has been passed, so build SQL here
    SQL = "bla bla bla"
  End If
%>

This way, there is no need for the form at all. You have an easy maintainable solution, because you are not writing out dynamic HTML, but just using some ASP variables inside your HTML.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #17 (permalink)  
Old September 9th, 2003, 02:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Tandy!

About the auto number. I do not know what others do on this matter but I can tell you what I have done...

I never use auto number; I use integer. I have made a small function which returns the smallest free integer. This makes sure that I fill out the numbers which I have deleted earlier for some reason.

Some would probably argue about the performance, however I do not think that it is an issue for non-large database tables (very large).

Your function could take table name, column name and connection string as arguments.

Best regards and good luck ;)

Jacob.


Reply With Quote
  #18 (permalink)  
Old September 9th, 2003, 08:20 AM
Authorized User
 
Join Date: Sep 2003
Location: Waco, TX, .
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

Good MOrning Imar,
And Thank you so much for sticking with me through this....
I tried it that way and all it is passing is the first record no matter whitch rec I click on, here is more of the code that you guys have not seen:

DO Until objRS.EOF
     strOutPutString = strOutPutString & "<TR>" & _
    "<TD valign=top><a href=Display.asp?ID=" & intID & "><img src=images/" & sImageName & ".gif></a>" & _
    "</TD><TD valign=top>" & objRS("priority") & "</TD>" & _
ect...
the images you see are named open(an open lock) clsed(a closed lock)When I do it the above way it makes all images open.
Reply With Quote
  #19 (permalink)  
Old September 9th, 2003, 08:29 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

It just shows one record, because you are passing intID, and *not* the ID from the database:
Code:
Do Until objRS.EOF
     strOutPutString = strOutPutString & "<TR>" & _
    "<TD valign=top><a href=""Display.asp?ID=" & objRS("ID") & """><img src=images/" & objRS("ImageName") & ".gif></a>" & _
    "</TD><TD valign=top>" & objRS("priority") & "</TD>" etc.
  objRS.MoveNext()
Loop
Of course I haven't seen the entire code, but it looks like your are assigning values to intID and sImageName once, and then assume they change automatically in the loop. Instead, retrieve the value for the ID and the ImageName inside the loop for each record, as I have shown above. The code assumes that there is a column called ID and a column called ImageName in the database.....

If I were you, I'd get used to enclosing your HTML attributes in double quotes. Simply use two double quotes in ASP to send a single double quote to the browser, as in my example. This will prevent loads of errors with attributes and values incorrectly interpreted / submitted.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #20 (permalink)  
Old September 9th, 2003, 08:34 AM
Authorized User
 
Join Date: Sep 2003
Location: Waco, TX, .
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

Good morning to you as well Jacob, Sorry I didnt see your post.. I was thinking the same thing. I had really not wanted to do that but at this point I don't think I have a choice. I'm going to spend some time tring to get Imars href link to work and if not I guess I'll have to do it this way. Once again you two will never know how much I appreciate your help.
Thanks Tandy
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:15 AM.


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