|
-
Dec 27th, 2002, 02:09 PM
#1
Thread Starter
Lively Member
Databases and HTML
I am trying to create a page where it has my database that I have already created. I guewss it requires javascript to do this and it also requires me to connect the database to a web page. I have the code and I think it is connected, but it doesn't work properly. Any ideas?
Thank you
-
Dec 27th, 2002, 03:31 PM
#2
Re: Databases and HTML
Originally posted by rgyankees23
I am trying to create a page where it has my database that I have already created. I guewss it requires javascript to do this and it also requires me to connect the database to a web page. I have the code and I think it is connected, but it doesn't work properly. Any ideas?
Thank you
Care to post the code here? AFAIK, it's not possible to connect to a database using HTML/Javascript.
-
Dec 27th, 2002, 04:20 PM
#3
Thread Starter
Lively Member
I can't post the code, so how can i get it to you or on here...
What does AFAIK mean?
and thirdly,
The Book, Beginnning JavaScript, pages 694 from Chapter 16 has a section called, "Accessing Databases from a web page."
But if it isn't possible then what over way can I do it....
-
Dec 28th, 2002, 02:25 AM
#4
Originally posted by rgyankees23
I can't post the code, so how can i get it to you or on here...
You can PM it to me, if you'd like.
As Far As I Know
and thirdly,
The Book, Beginnning JavaScript, pages 694 from Chapter 16 has a section called, "Accessing Databases from a web page."
But if it isn't possible then what over way can I do it....
THe reason you can't do it is because you're attempting to do it client side. Javascript can access databases, but if it is running as a server side script. If you check Chapter 16, it might mention it somewhere in the beginning itself. For example, if you have PWS or IIS on your machine, you'll be able to use that code.
-
Dec 30th, 2002, 04:13 PM
#5
Originally sent from rgyankees23 to mendhak
I have nmo idea what that means
Here is the code....
//
<center>2003 New York Yankees Schedule</center>
<table border=1>
<thead>
<tr>
<th>GameID</th>
<th>GameDate</th>
<th>GameTime</th>
<th>TeamA</th>
<th>TeamB</th>
</tr>
</thead>
<%
var adoConnection = Server.CreateObject("ADODB.Connection");
var adoRecordset;
var mySQL;
adoConnection.Open("DSN=2003yankeeschedule");
var mySQL = "Select GameID, GameDate, GameTime, TeamA, TeamB"
adoRecordset = adoConnection.Execute (mySQL);
while ( adoRecordset.Eof == false )
{
%>
<tr>
<td><%=adoRecordset ("GameDate").Value%></td>
<td><%=adoRecordset ("GameTime").Value%></td>
<td><%=adoRecordset ("TeamA").Value%></td>
<td><%=adoRecordset ("TeamB").Value%></td>
</tr>
<%
adoRecordset.MoveNext ();
}
adoRecordset.Close();
adoRecordset = null;
adoConnection.Close ();
adoConnection = null;
%>
</table>
//
OK, the code you have posted will work, only server side, as mentioned before. This means that your server must be configured to support and execute ASP scripts. For this, you need a web server such as PWS or IIS.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|