Welcome to WebmasterWorld Guest from 54.158.36.59

Forum Moderators: phranque

Message Too Old, No Replies

ASP how to select a specific record from a recordset

     
8:05 pm on Aug 21, 2002 (gmt 0)

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



the basic situation is that i have a recordset of 8 products...
i don't want to display them down the page in tabular method as usual, but i want them to appear according to my specific layout (i'm drawing pic url, price, in/out of stock from the db) this can't be a static page as although i always want to show the same products in the same way - the price and the availablity changes on a regular basis.

surely i must be able to get the data from the record set and associate the correct record with each item on the page.

alternatively i thought of creating a page/script that would write to a file (in this case html) when the database is updated (daily) this way it could be a "static" page but that was dynamically written each night when the database is updated.

any thoughts or alternative asp gratefully recieved

8:15 pm on Aug 21, 2002 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You can do what you want without difficulty. Are you using javascript or VBscript for your ASP code?

There is a great site with tons of tutorials on ASP: www.w3schools.com

But there are so many variables in getting the data. What type of database are you connecting to? Were you able to get all your data loaded?

There are lots of folks here who can help with ASP.

8:33 pm on Aug 21, 2002 (gmt 0)

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



>>>Are you using javascript or VBscript for your ASP code?

i'm using vbscript

>>>There is a great site with tons of tutorials on ASP: www.w3schools.com

great am very happy to dive in, i'm proficient with ultradev but beyond that my hand tweaking skills are at a basic level but am willing to get down 'n dirty ... just need a bit of a pointer as to what kind of tutorial to look for
is this to do with the command object??

>>>What type of database are you connecting to? Were you able to get all your data loaded?

connecting to an access db, not sure what you mean by "Were you able to get all your data loaded?"

thanks

2:45 am on Aug 22, 2002 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member



In VBScript it's easy to capture a particular data row item. Here is a little bit of code that opens the connection, reads the data, and sets a value:
<%
dim code
code = Session("schoolcode")
Set RSEVENT = Server.CreateObject("ADODB.RecordSet")
RSEVENT.Open "SELECT * FROM CalEvents where schcode='" & code & "'", Conn, 1, 3
%>

RSEVENT("eDate")

This shows the contents of the DB field "eDate" on the web page.

Ultradev is a great way to get started, but take some time and study the code so you know what is going on. Pretty soon you'll be able to hand code (cut and paste) what you need to do. The DW code tends to be very bloaty. I especially dislike the way they handle the delete command. About 75 lines of code when all you need is about 5.

Take some time with w3schools.com and have fun with it!

10:27 am on Aug 23, 2002 (gmt 0)

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



thanks for the pointers txbakers ...

so much to do, so little time !

2:38 am on Aug 26, 2002 (gmt 0)

10+ Year Member



Hi topr8

You need to research the following at W3schools in this order fi possible.

vbscript a few hours should do
asp a few hours again
then ADO very important.

Hope this helps if you need more help could I suggest pacosdrivers.com they have some free scripts that you can take apart. I found this useful to make all the stuff I leant from w3schools click together.

Good Luck

 

Featured Threads

Hot Threads This Week

Hot Threads This Month