Sign in to follow this  
blackbirdblackbird1

[web] ASP MSAccess Database Help (Solved)

Recommended Posts

I am using a page that uses a post/get address (IE: http://localhost/sport.asp?id=3) to get information from an access database. I have a table named "sport_select" (this is the table that the asp uses for the info from the url) Ahh forget it... the easiest way I can describe it is through a picture. here: http://labsply.com/ASP_SQL.gif hopefully it makes sence. It seems to be the only way I can think of doing it, but then again I don't know much about ASP. If either someone could clear up my mistake(s) or show me a more efficient way, it would be greatly appreciated! Ohh and the reason I cant combine all of the tables is because it would be a pain to display (and it would look crappy) and there would have to be like 50 schedule columns and like 30 player columns. [Edited by - blackbirdblackbird1 on August 7, 2007 3:41:41 PM]

Share this post


Link to post
Share on other sites
ArchG    327
I'm not really understanding your question. Does this not work? Without knowing more about what type of info you're trying to hold I can't really suggest another way of doing what you're doing.

[Edited by - ArchG on August 7, 2007 2:59:32 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by ArchG
I'm not really understanding your question. Does this not work? Without knowing more about what type of info you're trying to hold I can't really suggest another way of doing what you're doing.



Here is the code for the post/get (sport.asp?id=3):


<%
Option Explicit ' not necessary, but good practice

Dim id, sport

' get id parameter, in this case we're checking if it's a number
If IsNumeric(Request("id")) Then
id = CLng(Request("id"))
Else
id = 0
End If
%>


<%

Dim conn
Dim rs

' initialize connection and recordset

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:\Inetpub\AUSDpublic\ahs\sports.mdb"

set rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT TOP 1 * FROM sport_select WHERE id = " & id, conn

Dim player
player = rs("play_db")
%>



What that should do is tell the database which row to look at.

The next code is another connection to the same DB but a different table:

HAHAHAHAHA...........

Let me explain myself. When I was in the middle of getting the second connection code I somehow made it work and after about 5 min of teaking it I got it running!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this