beautypg.com

Create a connection using a connection string, Connecting to a database on an isp – Adobe Dreamweaver CC 2015 User Manual

Page 556

background image

549

Dynamic sites, pages and web forms

Last updated 6/3/2015

5

Select Using DSN On Testing Server.

Note: Macintosh users can ignore this step because all database connections use DSNs on the application server.

6

Enter the DSN or click the DSN button to connect to the server and select the DSN for the database you want, then
complete the options.

7

Complete the User Name and Password boxes.

8

You can restrict the number of database items Dreamweaver retrieves at design time by clicking Advanced and
entering a schema or catalog name.

Note: You cannot create a schema or catalog in Microsoft Access.

9

Click Test to connect to the database, and then click OK. If the connection fails, double-check the connection string
or check the settings for the testing folder Dreamweaver uses to process dynamic pages.

Create a connection using a connection string

You can use a DSN-less connection to create an ODBC or OLE DB connection between your web application and your
database. You use a connection string to create this kind of connection.

1

Open an ASP page in Dreamweaver, and then open the Databases panel (Window > Databases).

2

Click the Plus (+) button on the panel, select Custom Connection String from the menu, complete the options, and
click OK.

3

Enter a name for the new connection without spaces or special characters.

4

Enter a connection string to the database. If you do not specify an OLE DB provider in the connection string—that
is, if you don’t include a Provider parameter—ASP will automatically use the OLE DB provider for ODBC drivers.
In that case, you must specify an appropriate ODBC driver for your database.

If your site is hosted by an ISP and you don’t know the full path to your database, use the MapPath method of the
ASP server object in your connection string.

5

If the database driver specified in the connection string is not installed on the same computer as Dreamweaver,
select Using Driver On Testing Server.

Note: Macintosh users can ignore this step because all database connections use the application server.

6

You can restrict the number of database items Dreamweaver retrieves at design time by clicking Advanced and
entering a schema or catalog name.

Note: You cannot create a schema or catalog in Microsoft Access.

7

Click Test to connect to the database, and then click OK. If the connection fails, double-check the connection string
or check the settings for the testing folder Dreamweaver uses to process dynamic pages.

Connecting to a database on an ISP

If you’re an ASP developer working with a commercial Internet service provider (ISP), you often don’t know the
physical path of the files you upload, including your database file or files.

If your ISP doesn’t define a DSN for you or is slow to do so, you must find another way to create the connections to your
database files. One alternative is to create a DSN-less connection to a database file, but you can define such a connection
only if you know the physical path of the database file on the ISP server.

You can obtain the physical path of a database file on a server by using the MapPath method of the ASP server object.

Note: The techniques discussed in this section apply only if your database is file-based, such as a Microsoft Access database
where data is stored in an .mdb file.