Problem with ASP web site...

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Ophidian

Thread Starter
Joined
Jul 14, 2001
Messages
119
Ok well a friend of mine is working on making a site and he's doing it in ASP. Now, I'm not really fluent in web design so I'm kinda stuck as much as he is. Maybe someone here can provide some help. It's apparently not recognizing the database for some reason which we can't figure out. Here is the code for the portion of the site that isn't working:

<%@ Language="JavaScript" %>
<!-- #include file="adojavas.inc" -->


<html>
<head></head>

<body>


<br>
<hr width=700>

<center><h1> Online Catalog</h1></center>

<hr width=700>


<br>
<br/>

<%
var strConn="dsn=project2;uid=wchaudry;pwd=75006363;";
var dbConnection= Server.CreateObject("ADODB.Connection");
var objrecord = Server.CreateObject("ADODB.Recordset");

dbConnection.Open(strConn);

if(dbConnection.State == "adStateClosed")
Response.Write(" Sorry, could not connect to the database");
else
{
Response.Write("<table border=1 align=center> <tr><td>Author</td> <td>Title</td> <td>Publisher</td><td>In Stock</td> <td>Price</td></tr>");
objrecord.Open("Books", dbConnection, adOpenForwardOnly, adLockReadOnly, adCmdTable);

while(!objrecord.EOF)
{
var tauthor= objrecord("AuthorLastName") + "," + objrecord("AuthorFirstName")
var ttitle = objrecord("Title");
var tisbn = objrecord("ISBN");
var tpublisher = objrecord("Publisher");
var tprice = objrecord("Cost");
var tinstock = objrecord("InStock");
Response.Write("<tr> <td>" + tauthor+ " </td> <td> <a href= 'bookdetails.asp?id="+tisbn+ "'>" + ttitle + "</a></td> <td>" + tpublisher + "</td> <td>" + tinstock + "</td><td>" + tprice + "</td></tr>");
objrecord.MoveNext();
}
}

%>


</body>

</html>

Copying and pasting it made it a lil messy there... sorry about that... if you need the rest of the code just let me know and I'll post it. Any help would be greatly appreciated. Thanks.
 

Ophidian

Thread Starter
Joined
Jul 14, 2001
Messages
119
Heh, alright I wasn't expecting it to actually implement the code there...

//<%@ Language="JavaScript" %>
//<!-- #include file="adojavas.inc" -->
//
//
//<html>
// <head></head>
//
// <body>
//
//
// <br>
// <hr width=700>
//
// <center><h1> Online Catalog</h1></center>
//
// <hr width=700>
//
//
// <br>
// <br/>
//
// <%
// var strConn="dsn=project2;uid=wchaudry;pwd=75006363;";
// var dbConnection= Server.CreateObject("ADODB.Connection");
// var objrecord = Server.CreateObject("ADODB.Recordset");
//
// dbConnection.Open(strConn);
//
// if(dbConnection.State == "adStateClosed")
// Response.Write(" Sorry, could not connect to the database");
// else
// {
// Response.Write("<table border=1 align=center> <tr><td>Author</td> <td>Title</td> <td>Publisher</td><td>In Stock</td> <td>Price</td></tr>");
// objrecord.Open("Books", dbConnection, adOpenForwardOnly, adLockReadOnly, adCmdTable);
//
// while(!objrecord.EOF)
// {
// var tauthor= objrecord("AuthorLastName") + "," + objrecord("AuthorFirstName")
// var ttitle = objrecord("Title");
// var tisbn = objrecord("ISBN");
// var tpublisher = objrecord("Publisher");
// var tprice = objrecord("Cost");
// var tinstock = objrecord("InStock");
// Response.Write("<tr> <td>" + tauthor+ " </td> <td> <a href= 'bookdetails.asp?id="+tisbn+ "'>" + ttitle + "</a></td> <td>" + tpublisher + "</td> <td>" + tinstock + "</td><td>" + tprice + "</td></tr>");
// objrecord.MoveNext();
// }
// }
//
// %>
//
//
// </body>
//
//</html>
Code:
Alright, I hope that works... if you copy the code, remember to take all the "//"s from the beginning of each line.
 

Ophidian

Thread Starter
Joined
Jul 14, 2001
Messages
119
Hahaha.... crap... alright now i'm gonna need to know how I can send the code... um, any ideas?
 

Ophidian

Thread Starter
Joined
Jul 14, 2001
Messages
119
Ok we figured out what the problem was and it's now fixed. Thanks for your help anyway.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top