<% Option Explicit On Error Resume Next '======================================================================== 'Configuration code '======================================================================== DIM strTitle DIM intConnection DIM bolNS DIM strDSN DIM strSQL DIM arrFAQ 'General settings strTitle = "Gram-Hansen - INFO" intConnection = 1 '1:Database, 2:XML File, 3:Array 'Database settings strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/") & "\familie\fpdb\faqgo.mdb" '"dsn=test;" strSQL = "SELECT faq_data.faq_question, faq_data.faq_answer FROM faq_data ORDER BY faq_data.faq_order;" 'Is this NS? If Request.QueryString("ns") = "true" Then bolNS = TRUE Else bolNS = FALSE End If Select Case intConnection Case 1 'Write script to use GetRows to fill the array from any database DIM objRS Set objRS = Server.CreateObject("ADODB.Recordset") With objRS .ActiveConnection = strDSN .Source = strSQL .CursorType = 3 .CursorLocation = 2 .LockType = 1 .Open End With If err.number <> 0 Then DIM strError strError = "

The following error occured trying to query the database:

" & err.description & "

" & err.source & "

" REDIM arrFAQ(1,0) arrFAQ(0,0) = "Where are all the questions?" arrFAQ(1,0) = strError Else If objRS.EOF Then REDIM arrFAQ(1,0) arrFAQ(0,0) = "Where are all the questions?" arrFAQ(1,0) = "The database is empty - no questions was found." Else arrFAQ = objRS.GetRows() End If End If objRS.Close Set objRS = Nothing Case 2 REDIM arrFAQ(1,0) arrFAQ(0,0) = "Where are all the questions?" arrFAQ(1,0) = "The XML file was not found or returned errors." Case Else 'FAQ Array set the last digit to the number of entries - 1 (it starts at 0) REDIM arrFAQ(1,6) 'The FAQ entries (0,x) = Question, (1,x) = Answer arrFAQ(0,0) = "How do I install the SpellChecker Xtra?" arrFAQ(1,0) = "The SpellChecker Xtra comes with its own install program. After you have downloaded the Xtra all you need to do is to run the program. The installation program should guide you through it from here." arrFAQ(0,1) = "How do I distribute the SpellChecker Xtra with my program?" arrFAQ(1,1) = "To distribute the Xtra with your program you should follow these steps:
  1. In Director Check the Xtra
  2. Make sure you own a license
" arrFAQ(0,2) = "Can I use multiple dictionaries like French and English at the same time?" arrFAQ(1,2) = "It is easy to use multiple dictionaries. You can both use multiple dictionaries AND multiple user dictionaries at the same time.

To use multiple dictionaries you need to...

To use multiple user dictionaries you need to....

" arrFAQ(0,3) = "Can I use images in the FAQ?" arrFAQ(1,3) = "Yes you can! Look at this it can't be much easier than that!" arrFAQ(0,4) = "How about HTML and Javascripts?" arrFAQ(1,4) = "Basically anything that can be shown on a HTML page can be included and shown in both the questions and the answers. Remember though that the entire FAQ is downloaded in the page, and the more stuff you fill into the answers the bigger the download and the slower for the client.

I recommend to keep it simple and to the point!

" arrFAQ(0,5) = "Can I use Tables in the answers?" arrFAQ(1,5) = "What did you ask me?
...if you can use tables?
Yesyes...and yes again

The stylesheet has been written so it doesn't interfere with the styles of the answers, except for the text and links.

" arrFAQ(0,6) = "Can this FAQ be used with a database?" arrFAQ(1,6) = "Yes indeed! You can couple a database to the FAQ easily by using the database coupler script in the beginning of the file. This will load the questions and the answers from any fields in any database you specify.

This means you can use any data you already have at hand!" End Select '======================================================================== 'Don't edit beyond this unless you know what you are doing '======================================================================== DIM strScript DIM intFAQCounter strScript = Request.ServerVariables("Script_Name") %> <%= strTitle %> <% If (NOT bolNS) Then %> <% End If %> onload="checkForNS();"<% End If %>> <% For intFAQCounter = 0 To UBound(arrFAQ,2) %> id="div<%=intFAQCounter%>" style="display:none;"<% End If %>> <% Next %>
<%= strTitle %>
<% If (NOT bolNS) Then %><% Else %><% End If %><% If (NOT bolNS) Then %><% End If %> <% If (NOT bolNS) Then %><% Else %><% End If %><%= arrFAQ(0, intFAQCounter) %>
<%= arrFAQ(1, intFAQCounter) %><% If bolNS Then %>

 

<% End If %>
<% If (NOT bolNS) Then %>

Legend:
Closed - click to show answer
Opened - click to hide answer

<% Else %>

 

<% End If %>

<%= strTitle %> is powered by FaqGo
Copyright 2001 by AddGo - All Rights Reserved