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

Database connection example_PHP tutorial

WBOY
Release: 2016-07-13 17:01:47
Original
765 people have browsed it

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...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template