"Database Developer: Cooking with Visual InterDev and Enterprise Application Ingredients"
by Ken North
Web Techniques, May 1999

Web Techniques grants permission to use these listings (and code) for 
private or commercial use provided that credit to Web Techniques and 
the author is maintained within the comments of the source. For 
questions, contact editors@web-techniques.com. 



[LISTING ONE]


<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
   '==Visual InterDev Generated - startspan==
   '--Project Data Connection
      Application("Scribes1_ConnectionString") = "DSN=MS_Articles;
         Description=Articles data (MSSQL 7.0 );SERVER=BURNS;UID=north;
         WSID=PLATINUM;DATABASE=articles;Address=Burns,1433"
      Application("Scribes1_ConnectionTimeout") = 15
      Application("Scribes1_CommandTimeout") = 30
      Application("Scribes1_CursorLocation") = 2
      Application("Scribes1_RuntimeUserName") = "north"
      Application("Scribes1_RuntimePassword") = "north2"
   '-- Project Data Environment
      Set DE = Server.CreateObject("DERuntime.DERuntime")
      Application("DE") = DE.Load(Server.MapPath("Global.ASA"), 
         "_private/DataEnvironment/DataEnvironment.asa")
   '==Visual InterDev Generated - endspan==
End Sub
</SCRIPT>



[LISTING TWO]


<!--#INCLUDE FILE="_ScriptLibrary/Recordset.ASP"-->
<SCRIPT LANGUAGE="JavaScript" RUNAT="server">
function _initRecordset1()
{
   thisPage.createDE();
   var rsTmp = DE.Recordsets('Article');
   Recordset1.setRecordSource(rsTmp);
   Recordset1.open();
   if (thisPage.getState('pb_Recordset1') != null)
      Recordset1.setBookmark(thisPage.getState('pb_Recordset1'));
}
function _Recordset1_ctor()
{
   CreateRecordset('Recordset1', _initRecordset1, null);
}
function _Recordset1_dtor()
{
   Recordset1._preserveState();
   thisPage.setState('pb_Recordset1', Recordset1.getBookmark());
}
</SCRIPT>