'/-----------------------------------------------------------------------
'/ Desc:将文件以二进制流的形式写入数据库中
'/ Author:By Bytesoon
'/-----------------------------------------------------------------------
Public dbConn As ADODB.Connection
Public curImgPath As String
' 创建并打开数据库
Public Function OpenDB(dbServer As String, dbName As String) As Boolean
Err.Clear
OpenDB = False
'创建数据库连接对象
Set dbConn = New ADODB.Connection
'设置为可以读写操作
dbConn.Mode = adModeReadWrite
'访问SQLserver
dbConn.Provider = "sqloledb"
On Error Resume Next
'打开数据库连接
dbConn.Open "Data Source=" & dbServer & ";Initial Catalog=" & dbName & ";Persist Security Info=false;User ID=sa"
If Err.Number <> 0 Then
MsgBox "Co