After downloading our 1 Click Db you will need to install it on your web server. This is a simple matter of unzipping the downloaded files into a directory on your web server. Once the files have been extracted, our program can be run right from your web browser. So if your web server is named "example.com" and you unzipped your files into a directory on your web server named "1clickdb", you would start our program by pointing your web browser to:
http://example.com/1clickdb/default.asp
1 Click DB must be run on a web server. The program will not run unless accessed from a web server via http:// in your favorite browser !
You should be able to create or connect to any Microsoft Access or SQL Server database accessible to your web server as soon as you start using 1 Click DB. When using the MS Access connect wizard, it is preferred that you enter the full physical path to the .MDB database file to connect. for example:
c:\inetpub\data\mydb.mdb
If your database is in a web folder this syntax will work as well:
/fpdp/timesystem.mdb
If the connect wizard sees a drive letter at the start of your path to Access .mdb, it will pass this physical path to the connection directly. Otherwise it will wrap the path into a call to Server.Mappath(). If you do not put a forward slash / at the beginning of this type of web db path, IIS usually thinks you mean c:\winnt\system32. Please note we strongly do not recommend putting databases in the same folder as your 1 Click DB scripts, they require different permission settings and are best kept in separate directories.
Creating Database Shortcuts
To avoid repetitive typing of connection information for your most commonly accessed databases it is often desirable to create various shortcuts. Here are some options :
The variable ocdADOConnection can be hard coded or set dynamically in the file ocdConfig.asp, Config.asp, or FreeConfig.asp (depending on version). When this variable is active, the dynamic Connect screen is not longer presented to the user and session variables become inactive. This allows easy integration with web farms and custom authentication schemes.
To create Shortcut dropdowns entries on Connect screen set ocdConnectionShortCuts variable in the configuration file. Syntax structure:
MyConnectionString1|MyName1;;MyConnectionString1|MyName2
Keep all on one line or an "Unterminated String" constant error will occur. Separated connection string from the friendly name using the pipe character | and separate the entries with semicolons ;; Do NOT put double semicolons at the end or you will get an error
To define a "Launch" page for 1 Click DB in the configuration file open file with any text editor and look for the following entry:
ocdLaunchPage = ""
If the ocdLaunchPage variable is blank as above, or not present at all, no launch page will be made active. Setting ocdLaunchPage to something like "Launch.htm" will activate the Start link in the 1 Click DB header with the appropriate link. The syntax to pass connection information can be taken from the Launch.htm page distributed with the application. Pass form or querystring variables named "Connect", "User" and "Pass" to the connect.asp page. For example, to auto-connect to the Northwind database in c:\wwwroot\data\ and jump directly to the table list use the following syntax for your HREF (all on one line):
connect.asp?action=connect& connect=provider%3DMicrosoft%2EJet%2EOLEDB%2E4%2E0%3B data+source%3DC%3A%5Cwwwroot%5Cdata%5CNorthwind%2Emdb
Notice that the path information is URLEncoded to stop special chachters from breaking layout in the browser or ASP even logic. To URLEncode textfor spaces " " are replaced with + , equal signs "=" are replaced with %3D , semicolons ";" are replaced with %3B , backslashes "\" are replaced with %5C , colons ":" are replaced with %3A , and periods "." are replaced with %2E . If your launch page is really an .asp page you can accomplish this much easier with the following syntax for your HREF (all on one line):
<%="connect.asp?action=connect&connect=" &
server.urlencode("provider=Microsoft.Jet.OLEDB.4.0;
data source=C:\wwwroot\data\Northwind.mdb") %>
Type Mismatch Errors With Localization
When using a database and/or web server that has international setting configured (i.e. is using Windows localization) you may find that many 1 Click DB screens display Type Mismatch (or equivalent) errors.
Both ASP and ADO can be configured to conform to international settings for things like dates and currency formats. 1 Click DB does not force you to use any particular international setting and works fine in all tested localizations situations when the database and web server are configured identically. However if these settings do not match on both the database and the web server, many logical comparisons will fail with a "Type Mismatch" error. If for some reason the database and web server are not configured to the same internationalization you can avoid reconfiguring them and simply force 1 Click DB to use the settings defined by the database. For the 1 Click DB application simply add the following line to your configuration file:
Session.LCID = 1029
1029 is the Microsoft localization code for US English. If your database is not localized to US English you can substitute whatever value is appropriate for your situation. For custom Code Wizard apps this line can be added in the format.asp file since ocdFormat.asp should be defined as an #INCLUDE on every custom page by default.
Although ADO connection generally return a "Locale Identifier" property this does not reliably indicate the actual database localization so it may take some trial and error to determine the exact value needed if you are unfamiliar with the configuration of the database.
Pre-Version 4.0 Compatibility : The file acwConfig.asp is used for configuring Session.LCID In Code Wizard apps the file Format.asp should be defined as an #INCLUDE on every custom page by default.