DSN Less connection for Access % set cnn = server.create" name="description" />

一个典型的SQL Server数据库连接范例

发表于:2007-06-21来源:作者:点击数: 标签:
OLE DB Method for SQL % set cnn = server.createobject("ADODB.Connection") cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE= sql servername;UID=username;PWD=password;DATABASE=databasename " %> DSN Less connection for Access % set cnn = server.create

   
  OLE DB Method for SQL
  <%
  set cnn = server.createobject("ADODB.Connection")
  cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=sqlservername;UID=username;PWD=password;DATABASE=databasename "
  %>
  

  DSN Less connection for Aclearcase/" target="_blank" >ccess
  <%
  set cnn = server.createobject("ADODB.Connection")
  cnn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\anydatabase.mdb"
  %>
  
  OLE DB Method for Access
  <%
  set cnn = server.createobject("ADODB.Connection")
  cnn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=c:\anydatabase.mdb"
  %>
  
  File DSN Connection Method for Access
  <% set cnn = server.createobject("ADODB.Connection")
  cnn.open "FILEDSN=AccessDSN"
  %>

原文转自:http://www.ltesting.net