Office中国论坛/Access中国论坛

标题: 测试 Microsoft SQL Server 2008 R2 Express 连接数 [打印本页]

作者: zhuyiwen    时间: 2012-8-10 13:44
标题: 测试 Microsoft SQL Server 2008 R2 Express 连接数
今日测试 Microsoft SQL Server 2008 R2 Express (下载链接: http://www.microsoft.com/zh-cn/download/details.aspx?id=23650) 连接数:
测试代码:
  1. Option Explicit

  2. Const CONNSTR = "Provider=SQLOLEDB;Data Source=192.168.33.2,1435;User ID=sa;Password=******;Initial Catalog=master"
  3. Const POOL = ";Pooling=true;Max Pool Size=40000;Min Pool Size=0;"
  4. Dim i As Long

  5. Dim col As New Collection


  6. Private Sub Command1_Click()
  7.     On Error GoTo err_handle
  8.     Dim conn As ADODB.Connection
  9.     Dim cs As String
  10.     cs = Me.Text2
  11.    
  12.     If Me.Check1.Value = 1 Then
  13.         cs = cs & POOL
  14.     End If
  15.    
  16.     i = 0
  17.    
  18.     Do While True
  19.         DoEvents
  20.         Set conn = New ADODB.Connection
  21.         conn.Open cs
  22.         col.Add conn
  23.         i = i + 1
  24.         
  25.         Me.Text1 = i
  26.     Loop
  27.     Exit Sub
  28.    
  29. err_handle:
  30.     MsgBox "Down!" & vbNewLine & vbNewLine & Err.Number & " -- " & Err.Description
  31.     Err.Clear
  32. End Sub

  33. Private Sub Command2_Click()
  34.     Dim c As ADODB.Connection
  35.     For Each c In col
  36.         c.Close
  37.         Set c = Nothing
  38.     Next
  39.    
  40.     Dim i As Long
  41.     Dim t As Long
  42.     t = col.Count
  43.     For i = t To 1 Step -1
  44.         col.Remove i
  45.     Next
  46. End Sub

  47. Private Sub Form_Load()
  48.     Me.Text2 = CONNSTR
  49. End Sub
复制代码
[attach]50130[/attach]

远程连接数:62个


[attach]50129[/attach]

本地TCP/IP连接数:3960个


[attach]50128[/attach]

本地Share Memory 连接数:14771个(受内存限制)

作者: zhuyiwen    时间: 2012-8-10 13:50
由此可见,如果一个企业少于60个连接SQL Server 2008 R2 Express用户的话,以SQL Server 2008 R2 Express支持 10G 数据库容量的能力,完全能够胜任应用(1 个 ADP 应用程序 1 个 ADO SQL 连接)。

从目前软件版权日趋重要的情况看来,最重要的是它是免费的
作者: 风中漫步    时间: 2012-8-12 10:38
免费的东西越来越少了
作者: 李力军2    时间: 2013-8-22 23:36
{:soso_e179:}
作者: jlf001    时间: 2016-4-10 15:41
学习
作者: jlf001    时间: 2016-4-10 15:46
学习




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3