Public Const DBName = "FoxData.mdb"
Public Const DBpass = ""
Public conn As New ADODB.Connection
Public Rs1 As New ADODB.Recordset
Public Rs2 As New ADODB.Recordset
Public Rs3 As New ADODB.Recordset
Public Rs4 As New ADODB.RecordsetPublic Sub OpenDB()
Dim DBpath As String
DBpath = App.Path + "\" + DBName
conn.Open "provider=Microsoft.Jet.oledb.4.0data source=" &DBpath &"Jet OLEDB:Database Password=" &DBpass &""
End Sub
'******************************************
'关闭数据库
Public Sub CloseDB()
On Error Resume Next
conn.Close
Set conn = Nothing
End SubPublic Sub OpenRs(ByVal RsNum As Integer, ByVal RsSql As String)
Select Case RsNum
Case 1: Rs1.Open RsSql, conn, adOpenKeyset, adLockPessimistic
Case 2: Rs2.Open RsSql, conn, adOpenKeyset, adLockPessimistic
Case 3: Rs3.Open RsSql, conn, adOpenKeyset, adLockPessimistic
Case 4: Rs4.Open RsSql, conn, adOpenKeyset, adLockPessimistic
End SelectEnd Sub
Public Sub CloseRs(ByVal RsNum As Integer)
Select Case RsNum
Case 1: Rs1.Close: Set Rs1 = Nothing
Case 2: Rs2.Close: Set Rs2 = Nothing
Case 3: Rs3.Close: Set Rs3 = Nothing
Case 4: Rs4.Close: Set Rs4 = Nothing
End Select
End Sub
之前参加过一次微码邓白氏的数据库营销案例分享会,看到一些很有意思的案例,不过不知道你想要哪方面的案例,有没有具体需求或者行业,我可以跟你分享,他们b2b数据库营销做的比较久,又有邓白氏商业数据库支持,有不少客户案例分析。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)