WEB开发网
开发学院数据库MSSQL Server 一个典型的SQLServer数据库连接范例 阅读

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

 2007-11-11 08:57:02 来源:WEB开发网   
核心提示:OLE DB Method for SQL<%set cnn = server.createobject("ADODB.Connection")cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=sqlservername;UID=username;PWD

  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 Access
  <%
  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"
  %>

Tags:一个 典型 SQLServer

编辑录入:coldstar [复制链接] [打 印]
赞助商链接