[web] ASP MSAccess Database Help (Solved)

This topic is 3849 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

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 on other sites
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 on other sites
Quote:
 Original post by ArchGI'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 practiceDim id, sport' get id parameter, in this case we're checking if it's a numberIf IsNumeric(Request("id")) Then	id = CLng(Request("id"))Else	id = 0	End If%><%	Dim conn	Dim rs		' initialize connection and recordsetset 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, connDim playerplayer = 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!