熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

使用ADO對象連接SQL Server數據庫

2022-06-13   來源: .NET編程 

  鏈接代碼如下

Private Sub Command_Click()
Dim cn As Connection
Dim rs As Recordset
Dim str As String
Set cn = New ADODBConnection
str = Provider=SQLOLEDB;Persist Security Info=False;User ID=sa;Initial Catalog=RSDAGLXT;Data Source=
cnOpen str
Set rs = New ADODBRecordset
rsCursorType = adOpenKeyset
rsLockType = adLockOptimistic
rsOpen 人事檔案信息表 cn
Set MSHFlexGridDataSource = rs
End Sub


From:http://tw.wingwit.com/Article/program/net/201311/15251.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.