Print Page | Close Window

dynamic profiles

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=859
Printed Date: 28 March 2026 at 9:10pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: dynamic profiles
Posted By: jaz9090
Subject: dynamic profiles
Date Posted: 09 March 2003 at 8:38am

can anyone help me? I'm making a website for my hockey club and want to have player profiles a bit like this : http://www.xkewl.com/bhhhcdynamic/profile.asp - http://www.xkewl.com/bhhhcdynamic/profile.asp , but what i would like is for it to be dynamic and access db driven so i just have to add info to db to add a new player rather than add a whole profile page each time, so i can just add a link like http://www.xkewl.com/bhhhcdynamic/profile.asp?Player=223 - http://www.xkewl.com/bhhhcdynamic/profile.asp?Player=223 the problem is i havent the first idea how to go about it, so any help would be appreciated

p.s. i dont need an admin page, i understand access db (and how to edit etc)




Replies:
Posted By: faubo
Date Posted: 09 March 2003 at 10:34am

Make your table with those information, and put a field with an autonumber (the key), let's say, PlayerID.

Then you make your query looking for that Player,

Something like this:

first you get the ID from your querystring:

lngPlayer = CLng(Request.QueryString("Player"))

Then you take the info from the DB.

"SELECT yourtable.* FROM yourtable WHERE yourtable.PlayerID = " & lngPlayer & ""

And your links will look like the one you post above to the profile page with ?Player=223 after the .asp



-------------
http://www.conhecerparaconservar.org - I don't know how to make you click here


Posted By: jaz9090
Date Posted: 09 March 2003 at 12:59pm

i dont suppose you could put a small example code together on here? (includeing the connection to the db etc the db being d:/domains/xkewl.com/private/profiles.mdb

i would realy appreciate it



Posted By: faubo
Date Posted: 09 March 2003 at 1:42pm

didn't you say you knew the access db stuff?

This is part of what I use in my news, take a look and adapt, don't forget to put your variables (the Dim stuff) and close the connections and recordsets after you use them.

And you should take a look in the DB tutorials in this site, there's where I learn this. It's more than worth the time you will spend.

<%

Set notiCon = Server.CreateObject("ADODB.Connection")

atarCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("../private/profiles.mdb") <- this is the path from the root, add more ../ for each folder level your app is in, if not in the root.

notiCon.Open atarCon

%>

<%

Dim rsNews  
Dim lngIDNews 

lngIDNews = CLng(Request.QueryString("NewsID"))
 

Set rsNews = Server.CreateObject("ADODB.Recordset")
 
qtrSQL = "SELECT tblNotic.* FROM tblNotic WHERE tblNotic.News_ID = " & lngIDNews & ""
 
rsNews.Open qtrSQL, atarCon
 
 %>



-------------
http://www.conhecerparaconservar.org - I don't know how to make you click here


Posted By: fernan82
Date Posted: 09 March 2003 at 3:05pm
I had to practice ASP so I did that code for you.....you can download it http://www.uz.webhop.info/fernan82/profile.zip - here  it's a zip with the script and a sample db...



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net