An OLE DB connection
string combines all the information your ASP.NET application needs
to connect to a database. Dreamweaver inserts
this string in your page’s server-side scripts for later processing
by your application server.
Dreamweaver provides you with string templates
to create OLE DB connection strings for ASP.NET applications. To
create a connection string, you replace placeholders in the template
with the requested parameter values. The following are sample parameters
for Microsoft Access and SQL Server databases.
Note: For the parameter values specific to other databases, see
the database vendor’s documentation or consult your system administrator.
- Case 1:
-
You have the .NET Framework on your local computer and you
want to connect to a Microsoft Access database called sdSchool.mdb
located in the following folder on your hard disk: c:\Inetpub\wwwroot\SkyDiveSchool\data\sdSchool.mdb.
Here are the parameters to create this connection string:
Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=c:\Inetpub\wwwroot\SkyDiveSchool\data\sdSchool.mdb;
- Case 2:
-
You use the .NET Framework on a remote development server
and you want to connect to a Microsoft Access database called mtnSchool.mdb
located on the server in the following folder: d:\users\tara\projects\MtnDrivingSchool\data\mtnSchool.mdb.
Here are the parameters to create the connection string:
Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=d:\users\tara\projects\MtnDrivingSchool\data\mtnSchool.mdb;
- Case 3:
-
You use the .NET Framework on a networked development server
called Savant and you want to connect to a Microsoft SQL Server
database called pubs on the server. Your SQL Server user name is
“sa” and there is no password. If you use the Managed Data Provider
for SQL Server (that is, if you chose SQL Connection in the Databases
panel), here are the parameters to create the connection string:
Data Source=Savant;
Initial Catalog=pubs;
User ID=sa;
Password=;