Macromedia dreamweaver 8-using dreamweaver Benutzerhandbuch
Connecting to a database on an ISP
631
5.
Enter the connection string and use the
MapPath
method to supply the DBQ parameter.
Suppose the virtual path to your Microsoft Access database is /jsmith/data/statistics.mdb.
The connection string can be expressed as follows if you use VBScript as your scripting
language:
The connection string can be expressed as follows if you use VBScript as your scripting
language:
“Driver={Microsoft Access Driver (*.mdb)};DBQ=” & Server.MapPath¬
("/jsmith/data/statistics.mdb")
("/jsmith/data/statistics.mdb")
The ampersand (&) is used to concatenate (combine) two strings. The first string is
enclosed in quotation marks and the second is returned by the
enclosed in quotation marks and the second is returned by the
Server.MapPath
expression. When the two strings are combined, the following string is created:
Driver={Microsoft Access Driver (*.mdb)};
DBQ=C:\Inetpub\wwwroot\accounts\users\jsmith\data\statistics.mdb
DBQ=C:\Inetpub\wwwroot\accounts\users\jsmith\data\statistics.mdb
If you use JavaScript, the expression is identical except that you use a Plus (+) sign instead
of an ampersand (&) to concatenate the two strings:
of an ampersand (&) to concatenate the two strings:
“Driver={Microsoft Access Driver (*.mdb)};DBQ=” + Server.MapPath¬
("/jsmith/data/statistics.mdb")
("/jsmith/data/statistics.mdb")
6.
Select the Using Driver On Testing Server option.
Macintosh users can ignore this step because all database connections use the
application server.
application server.
7.
Click Test.
Dreamweaver attempts to connect to the database. If the connection fails, double-check
the connection string.
the connection string.
If the connection still fails, contact your ISP to make sure the database driver you specified
in the connection string is installed on the remote server. Also check that the ISP has the
most recent version of the driver. For example, a database created in Microsoft Access
2000 will not work with Microsoft Access Driver 3.5. You need Microsoft Access Driver
4.0 or later.
in the connection string is installed on the remote server. Also check that the ISP has the
most recent version of the driver. For example, a database created in Microsoft Access
2000 will not work with Microsoft Access Driver 3.5. You need Microsoft Access Driver
4.0 or later.
8.
Click OK.
The new connection appears in the Databases panel.
9.
Update the database connection of existing dynamic pages, and use the new connection
with any new page you build.
with any new page you build.
To update the connection of a dynamic page, open the page in Dreamweaver, double-click
the recordset name in the Bindings panel or Server Behaviors panel, and select the
connection you just created from the Connection pop-up menu.
the recordset name in the Bindings panel or Server Behaviors panel, and select the
connection you just created from the Connection pop-up menu.