<% ' ########### QUOTE OF THE DAY ##############3 ' ### QUOTES IN WEBMENS DB Set quoteConn = Server.CreateObject("ADODB.Connection") quoteDBPath="C:\DOMAINS\ALEXANDRINA.NL\DB\quotes.mdb" quoteConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & quoteDBPath Function QuoteOfDay() Dim rsQuotes, cnQuotes Dim iRandom Dim iRecords Dim lQuote, lAuthor 'Dim DSN on error resume next Set rsQuotes = Server.CreateObject("ADODB.Recordset") Set rsQuotes.ActiveConnection = quoteConn With rsQuotes .CursorLocation = 3 .CursorType = 3 .LockType = 1 .Open "SELECT * FROM TB_QUOTES;" iRecords = .RecordCount RANDOMIZE iRandom = INT(iRecords * RND) .Move iRandom If Not .BOF or Not .EOF Then lQuote = .Fields("pQuote") lAuthor = .Fields("pAuthor") End If .Close End With If lQuote = "" Then lQuote = "No quote today..." lAuthor = "E.L. Luitsz" End If Set rsQuotes = Nothing quoteConn.Close : Set quoteConn = Nothing response.write err.description QuoteOfDay = "
" & lQuote & "
" & lAuthor & "
" End Function %> QUOTES <% Response.Write(QuoteOfDay()) %>