ADOxtra for Macromedia DirectorAccessing databases over Internet and from Shockwave
ADOxtra may be used to access databases over Internet right from usual Director movie or Shockwave movie.
MDAC (Microsoft Data Access Components) contain MS Remoting Provider (Provider=MS Remote) that is capable to retrieve or send recordset data over Internet via http or https protocols. MDAC have to be installed (usually it is already installed) on both client and server sides. Remoting provider is used on the client side. It connects to the server part via http (https) protocol. The server side has to be running IIS web site. IIS provides ISAPI extensions mechanism, which allows MS Remoting Provider to call its counter part on the server. IIS web site and server itself have to be properly configured to allow remote databasing. Also there are several server security issues to take into account.
Note: IIS installed with Win 2k Pro (Personal Web Server) does not support RDS. The server should be running Win 2k or Win NT Server editions.
Note, ADOxtra is limited to remote only databasing while it is used from Shockwave movie. This limitation is done intentionally to conform Shockwave safety requirements.
Server configuration and security for remote databasing
At first, web server used for remote databasing must contain virtual directory MSADC with "execute programs" enabled. This virtual directory has to contain msadcs.dll file. Copy this file from C:\Program Files\Common Files\System\msadc.
Server security may need to be adjusted to allow remote databasing. By default, ADO is installed with a "safe" server configuration. The registry file handsafe.reg (C:\Program Files\Common Files\System\msadc) has been provided to set up the handler registry entries for a safe configuration. To ensure you your server runs in a safe mode, run handsafe.reg. The registry file handunsf.reg has been provided to set up the handler registry entries for an unrestricted configuration. To run in unrestricted mode, run handunsf.reg.
Safe configuration uses Msdfmap.ini file located in Windows (probably WinNT) directory. You must configure this file according to your needs, before using remote databasing. By default this file denies all remote connections to databases. Msdfmap.ini file may specify valid data sources that are allowed to access remotely, named SQL queries, access rights etc. See msdn library to get more information about this file or look at the file itself since it contains necessary information and samples.
To get remote access to the database you have to be able to access database locally on the web server's computer. Note that IIS may execute server part of RDS under IIS's Internet user account (IUSR_ComputerName). This may be important when connecting to MS SQL Server or databases over LAN.
The typical msdfmap.ini file may look like:
[connect default]
;If we want to disable unknown connect values, we set Access to NoAccess
Access=NoAccess
[connect YourDataSourceName]
Access=ReadWrite
Connect="YourConnectionStringHereToBeUsedOnServer"
This data source name may be used in connection string specified by client. Furthermore, this is the only valid data source name in this example, since all remote connections other then YourDataSourceName will be blocked by [connect default] section. To provide even more security, you may also define named SQL queries, which will be the only allowed SQL queries from remote clients.
Client side
At client side (it is your usual Director movie or Shockwave movie somewhere in the world, that is running on the machine connected to the Internet) you have to specify the correct connection parameters. You have to specify that you are going to use MS Remote provider to connect to your web site via http and your web server will use the data source name specified in server's Msdfmap.ini or some other provider to access some database. See examples below. Also you may set Internet Timeout property. It defines how long client will wait for the answer in milliseconds. Default setting is 5 minutes.
Note, the above sample of msdfmap.ini file allows you to only use connection string below, since other data sources will be blocked by Access=NoAccess statement of the [Connect Default] section:
Using data source name specified in msdfmap.ini file on web server:
connectionString="Provider=MS Remote; Data Source=YourDataSourceName; Remote Server=http://YourWebServer; Internet Timeout=300000"
In this case the actual connection string is contained in [connect YourDataSourceName] section of the Msdfmap.ini file (See above).
If you do not worry about security you may allow default remote access to databases through your web server. Just set required access type in Access=ReadWrite statement of the [Connect Default] section. If default access is enabled you may use 'fully qualified' connection strings on the client side:
MS Access databases over Internet:
connectionString="Provider=MS Remote; Data Source=D:\DemoDB; Mode=Read; Remote Server=http://YourWebServer; Remote Provider=Microsoft.Jet.OLEDB.4.0; Internet Timeout=300000"
MS SQL Server:
connectionString="Provider=MS Remote; Data Source=SqlServerName; Initial Catalog=DemoDB; Remote Server=http://YourWebServer; Remote Provider=SQLOLEDB.1; Internet Timeout=300000"
ODBC system DSN:
connectionString="Provider=MS Remote; Data Source=YourSystemDSN; Remote Server=http://YourWebServer; Remote Provider=MSDASQL.1; Internet Timeout=300000"
After setting correct connection string you may use Connection or Recordset objects as usual. Note that real data transfer occurs when you open recordset or update it.
Director settings for auto downloading ADOxtra from Shockwave
To use ADOxtra from Shockwave several extra steps are required:
At first you have to place the ADOxtra package (certified by Verisign) on your web site. Otherwise you may use package available at:
http://www.xtramania.com/package/ADOxtra.w32 and
http://www.xtramania.com/package/ADOxtraLite.w32.
Then you have to modify xtrainfo.txt file located in you Director installation folder. This file provides the master list of xtras known to Director. Add following lines to the end of this file:
[#nameW32:"ADOxtra.x32", #info:"http://www.xtramania.com/", #package:"http://www.xtramania.com/package/ADOxtra"]
[#nameW32:"ADOxtraLite.x32", #info:"http://www.xtramania.com/", #package:"http://www.xtramania.com/package/ADOxtraLite"]
Replace the #package values to the location on your web server where package file resides. Note: file and folder names in url may be case sensitive.
After modifying this file you may run Director, open the movie you are going to use from Shockwave and then invoke the Modify/Movie/Xtras dialog. Find (or add) the ADOxtra (ADOxtraLite) entries and place the check mark near "Download if needed" and "Include in projector". Director will check whether package file is available at this moment. Then you may save the movie as Shockwave and try it.
Several check points of proper RDS setup
See the FAQ for a list of tips about setting up a web server for remote databasing.
|