没有合适的资源?快使用搜索试试~ 我知道了~
首页数据库连接大全--各种数据库连接方式
数据库连接大全--各种数据库连接方式
5星 · 超过95%的资源 需积分: 9 9 下载量 56 浏览量
更新于2023-03-16
评论
收藏 191KB DOC 举报
数据库连接大全--各种数据库连接方式,包括SQLserver、Oracle、Mysql、Excel、Access等,十分全面
资源详情
资源评论
资源推荐
SQL Server
ODBC
o Standard Security:
"Driver={SQL
Server};Server=Aron1;Database=pubs;Uid=sa;Pwd=asdasd;"
o Trusted connection:
"Driver={SQL
Server};Server=Aron1;Database=pubs;Trusted_Connection=yes;"
o Prompt for username and password:
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Driver={SQL
Server};Server=Aron1;DataBase=pubs;"
OLE DB, OleDbConnection (.NET)
o Standard Security:
"Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User
Id=sa;Password=asdasd;"
o Trusted Connection:
"Provider=sqloledb;Data Source=Aron1;Initial
Catalog=pubs;Integrated Security=SSPI;"
o Prompt for username and password:
oConn.Provider = "sqloledb"
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Data Source=Aron1;Initial Catalog=pubs;"
o Connect via an IP address:
"Provider=sqloledb;Data Source=190.190.200.100,1433;Network
Library=DBMSSOCN;Initial Catalog=pubs;User
ID=sa;Password=asdasd;"
!"#!$%&$'('$)'()
)*+,,)'(
SqlConnection (.NET)
o Standard Security:
"Data Source=Aron1;Initial Catalog=pubs;User
Id=sa;Password=asdasd;"
---.--.
"Server=Aron1;Database=pubs;User
ID=sa;Password=asdasd;Trusted_Connection=False"
---/)0')
o Trusted Connection:
"Data Source=Aron1;Initial Catalog=pubs;Integrated
Security=SSPI;"
---.--.
"Server=Aron1;Database=pubs;Trusted_Connection=True;"
---/)0')
o Connect via an IP address:
"Data Source=190.190.200.100,1433;Network
Library=DBMSSOCN;Initial Catalog=pubs;User
ID=sa;Password=asdasd;"
!"#!$%&$'('$)'()
)*+,,)'(
o Declare the SqlConnection:
!12
0334!5
4!!"64!5
!3!0"7075
!3 5
839#2
&334!
!:4!"64!
!3!0"707
!3
Data Shape
o MS Data Shape
"Provider=MSDataShape;Data Provider=SQLOLEDB;Data
Source=Aron1;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
;')0<!)+=(>?@0
/)0AA
Read more
o How to de<ne which network protocol to use
Example:
"Provider=sqloledb;Data Source=190.190.200.100,1433;Network
Library=DBMSSOCN;Initial Catalog=pubs;User
ID=sa;Password=asdasd;"
Name Network library
dbnmpntw Win32 Named Pipes
dbmssocn Win32 Winsock TCP/IP
dbmsspxn Win32 SPX/IPX
dbmsvinn Win32 Banyan Vines
dbmsrpcn
Win32 Multi-Protocol (Windows
RPC)
Important note!
When connecting through the SQLOLEDB provider use the
syntax 6/"'/
and when connecting through MSDASQL provider use the
syntax 6"'/
o All SqlConnection connection string properties
This table shows all connection string properties for the ADO.NET
SqlConnection object. Most of the properties are also used in ADO.
All properties and descriptions is from msdn.
Name Default Description
Application
Name
The name of the application, or
'.Net SqlClient Data Provider' if
no application name is provided.
AttachDBFilena
me
-or-
extendedprope
rties
-or-
Initial File Name
The name of the primary <le,
including the full path name, of
an attachable database. The
database name must be
speci<ed with the keyword
'database'.
Connect
Timeout
-or-
Connection
Timeout
15 The length of time (in seconds)
to wait for a connection to the
server before terminating the
attempt and generating an
error.
Connection
Lifetime
0 When a connection is returned
to the pool, its creation time is
compared with the current time,
and the connection is destroyed
if that time span (in seconds)
exceeds the value speci<ed by
connection lifetime. Useful in
clustered con<gurations to force
load balancing between a
running server and a server just
brought on-line.
Connection
Reset
'true' Determines whether the
database connection is reset
when being removed from the
pool. Setting to 'false' avoids
making an additional server
round-trip when obtaining a
connection, but the programmer
must be aware that the
connection state is not being
reset.
剩余36页未读,继续阅读
xoyonline2
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- ExcelVBA中的Range和Cells用法说明.pdf
- 基于单片机的电梯控制模型设计.doc
- 主成分分析和因子分析.pptx
- 共享笔记服务系统论文.doc
- 基于数据治理体系的数据中台实践分享.pptx
- 变压器的铭牌和额定值.pptx
- 计算机网络课程设计报告--用winsock设计Ping应用程序.doc
- 高电压技术课件:第03章 液体和固体介质的电气特性.pdf
- Oracle商务智能精华介绍.pptx
- 基于单片机的输液滴速控制系统设计文档.doc
- dw考试题 5套.pdf
- 学生档案管理系统详细设计说明书.doc
- 操作系统PPT课件.pptx
- 智慧路边停车管理系统方案.pptx
- 【企业内控系列】企业内部控制之人力资源管理控制(17页).doc
- 温度传感器分类与特点.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1