|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Newbie Question (displaying db)
Alright...I have a very simple database consisting of one table with one column..the db name is Roster and the column name is Alias. I made a page where data can be put into it (I can't figure out how to edit and delete though
) and I have the script that actually puts the information into the database. Now this is where I'm having trouble. I want to put the database information onto a webpage in tables. I've tried so hard but to no avail. What code is needed to do this? I figured it wouldn't be so hard with only one table and column. Here is my other script. Form: <html><head> <TITLE>Update Roster</TITLE> </head><body bgcolor="#FFFFFF"> <form action="db.asp" method=post> <font face="Arial" size="2">Alias:</font> <INPUT NAME="name" MaxLength=20><p> <INPUT TYPE=submit><p><INPUT TYPE=reset> </form></body></html> and db.asp .. : <% Dim adoCon Set adoCon = Server.CreateObject("ADODB.Connection") adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("roster.mdb") 'adoCon.Open "DSN=roster" adoCon.Execute "INSERT INTO Roster (Alias) VALUES (" & "'" & request.form("name") & "'" & ")" %> <html> <head> <title>Thanks!</title> <style> A:link { color: #000000; text-decoration: none } A:visited { color: #000000; text-decoration: none } A:hover {color: #000000; text-decoration: none} </style> </head> <body> <table bgcolor="#666666" width="25%" align="center" border="1" bordercolor="#000000" cellspacing="0" cellpadding="0" style="border-collapse: collapse"> <tr> <td width="100%" align="center"><font face="arial" size="2" color="gold">Thanks!</font></td> </tr> <tr> <td width="100%" align="center"><font face="arial" size="2" color="gold"><a href="index.asp">Go Back</a></font></td> Now how do I display this data? Any help is appreciated. Thank you for your time. Last edited by ThreefoldDream : July 31st, 2002 at 02:07 AM. |
|
#2
|
||||
|
||||
|
adoCon.Execute "SELECT alias FROM roster" and then with a while ... you display all the rows of the table
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Newbie Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|