
Programming i!-Database Plus
28
i!-Database Plus and DBWizard
Putting It All Together
Once you have created all the files, it is time to put them to work. The first thing you want to do is
put the database, the NetLinxDBInclude.asp file, and database server script in a path accessible by
your web server. If you accepted the defaults when installing your web server, the root of the server
most likely exists in
C:\Inetpub\wwwroot
. The best thing to do is create a directory under this path
and place the database (MDB file) and database server script (ASP file) in this directory. If you
have your web server running, you should be able to call up the file in your browser. Try typing this
into your browser's address window:
http://192.168.012.175/DB/CDExample.asp
. This assumes
your IP address is
192.168.12.175
and you placed your file in a directory called DB
(
C:\Inetpub\wwwroot\DB
). Adjust these values to match your setup. If all goes well, you will see
the following message:
<?xml version="1.0" ?>
- <rsUnknown>
- <scriptError>
<errorNumber>0</errorNumber>
<errorDescription>No SQL Supplied</errorDescription>
</scriptError>
</rsUnknown>
If you do not get this message in your browser, there is no need to continue; NetLinx will not be
able to access the database. There is a problem in the setup. If the file is not found, the path is likely
to be wrong. If the script cannot connect to the database, the MDB file is not located in the same
directory as the script or the DSN entry is improperly setup.
If you get a
500 Internal Server Error
message when trying to view this page in a web browser,
the web server has not installed properly. You must correct this problem before proceeding.
Once you can correctly view the database server script in your browser, double check the path
setting in your call to
DB_INIT_CLIENT
. Enter the following as the IP address (or server name):
http://192.168.12.175
. The IP port number is usually
80
. In this case, you should enter
/DB/CDExample.asp
as the path to the database server script.
Now you are ready to compile and download your AXS file. Make sure the NetLinxDBInclude.axi
file is in the same directory as your AXS (and maybe AXI) files. Once you have compiled,
downloaded and rebooted your Master, you should be able to access the database. If you are having
any problems, check the NetLinx terminal using NetLinx Studio or Telnet and watch for error
messages.
You may see the No SQL Supplied message without any other formatting. If you do,
you are running a browser that does not support XML, but that is OK. You do not
need an XML compliant browser, and NetLinx will be able to access the database.