<!--#include virtual="/includes/topofpage.asp"-->
<%
	Dim objConn, objRS
%>

<%
Function DBConnect (SQL)
	Set objConn = Server.CreateObject("ADODB.Connection")
	ObjConn.ConnectionString = "DRIVER={SQL Server};SERVER=WEBSRV01;UID=web;pwd=w3bs1t3;DATABASE=Avante"
	objConn.Open	

	Set objRS = Server.CreateObject("ADODB.RecordSet")
	objRS.Open SQL, objConn
End Function
%>

<%
Function SQLFilter (Txt)
	'The SQLFilter function makes any string SQL safe, by
	'replacing single quotes with double quotes
	
	TXT = Replace(Txt, "'", "''")
	SQLFilter = TXT
End Function 
%>
 

<%
Function DBClose
	on error resume next
	objRS.Close
	objConn.Close
	Set objRS = Nothing
	Set objConn = Nothing
End Function 
%>


 

<%
Function PrintStatus (id)
	'a makeshift way of selecting a particular 
 	'article from the database, based on the unique identifier specified.

DBConnect "SELECT * FROM wysiwyg_tbl WHERE edit_id = " & id	

If Not objRS.EOF Then
	response.write objRS("edit_html")
End If

DBClose

End Function
%>