Home >Backend Development >PHP Tutorial >Database connection example_PHP tutorial

Database connection example_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:01:47768browse

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

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/631126.htmlTechArticleOLE DB Method for SQL % set cnn = server.createobject(ADODB.Connection) cnn.open PROVIDER=SQLOLEDB;DATA SOURCE=sqlservername;UID=username;PWD=password;DATABASE=databasename % DSN Le...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn