Not sure if this is the right forum. If this post belongs in a different one let me know.
I have a project that involves an
asp page reading data from
sql tables. The
asp page needs to show:
GuestName
GuestDescription
These are two columns in in the first table called T_ProgramGuests that I need the
asp page to read from. The columns are labeled:
GuestName
GuestDescription
The other table called T_ProgramLinks contains two columns called:
URL
Description
I need my
asp page to (and I'm not sure if this is right) have containers (or a better term) that holds some logic that reads from these tables. It simply displays the data in the
asp form when the user opens the page or refreshes it.
I will provide the limited code I currently have. I know this code isn't perfect or done but it's a start. I'm just not sure exactly how to do this. I sure could use some help.
ASP PAGE CODE
- Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"
"http://www.w3.org/MarkUp/Wilbur/HTML32.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>Company Name: - Title</title>
<link rel="stylesheet" type="text/css" href="screen_layout_l.css" media="screen" />
<link rel="stylesheet" type="text/css" href="screen_formatting.css" media="screen" />
<link rel="stylesheet" type="text/css" href="screen_design.css" media="screen" />
<link rel="stylesheet" type="text/css" href="style.css">
<script language="JavaScript">
<!--
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left ='+LeftPosition+',scrollbars='+scroll+',resizable= no'
win = window.open(mypage,myname,settings)
}
//-->
</script>
</head>
<%'************************************************ **************************
' This page will be used as a test page for Guests and Links
' its purpose is to simply read the guests and links tables then show
' what ever data is in them on the asp page.
'************************************************* *************************
Dim conDB
set con = Server.CreateObject("ADODB.Connection")
conDB.Open "File Name=E:\Webservice\Company\Company.UDL"
con.Open "PROVIDER=SQLOLEDB;DATA Source=Machine IP Address Here;Initial Catalog=company_program;User ID=sa;Password=testpassword"
set recShow = Server.CreateObject("ADODB.Recordset")
strGuestName = "SELECT * FROM T_ProgramGuests WHERE GuestName LIKE '?' & "'Guest Description'"
'recShow.Open strSQLShow,con
'If recShow.EOF Then
'Response.Write "Records have been retrieved!"
' Close and destroy recordsets
Response.End
recShow.Close
con.Close
' Close and destroy DB connection
conDB.Close
Set conDB = Nothing
%>
<p>Company Name<left><HR WIDTH="50%" SIZE="1" NOSHADE></left>
Article Headline<br />
3/7/2007
<br /><br />
Trust in Cyberspace<br /><br />
Your reputation follows you, even into cyberspace. Online reviews, peer comments and user opinions are changing the way we decide to trust other people. Technology reporter John Doe sees current website ratings leading the way to a new
standard of social acceptance.</p>
<form action="GuestsLinks.asp" method="post">
Guest Name: <INPUT type="hidden" ID="GuestName" NAME="Guest Name" value=""><br /><br />
Guest Description: <INPUT type="hidden" ID="GuestDescription" NAME="Guest Description" value="">
</form>
</body>
</html>
Some of this code may not make sense but thats because the correct syntax eludes me and I'm not exactly an
asp &
sql guru.
Any help is much appreciated!