Tech Support Guy banner
  • Please post in our Community Feedback thread for help with the new forum software! If you are having trouble logging in, please Contact Us for assistance.
Status
Not open for further replies.
1 - 5 of 5 Posts

·
Registered
Joined
·
119 Posts
Discussion Starter · #1 ·
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" %>



Online Catalog

<%
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("
AuthorTitlePublisherIn StockPrice
" + tauthor+ " " + ttitle + "" + tpublisher + "" + tinstock + "" + tprice + "
");
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(" ");
objrecord.MoveNext();
}
}

%>

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.
 

·
Registered
Joined
·
119 Posts
Discussion Starter · #2 ·
Heh, alright I wasn't expecting it to actually implement the code there...

//<%@ Language="JavaScript" %>
//
//
//
//
//
//
//
//
//
//
//

//
//

Online Catalog
//
//

//
//
//
//
//
// <%
// 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("
AuthorTitlePublisherIn StockPrice
" + tauthor+ " " + ttitle + "" + tpublisher + "" + tinstock + "" + tprice + "
");
// 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(" ");
// objrecord.MoveNext();
// }
// }
//
// %>
//
//
//
//
//
Code:
Alright, I hope that works... if you copy the code, remember to take all the "//"s from the beginning of each line.
 
1 - 5 of 5 Posts
Status
Not open for further replies.
Top