数据库设计案例分析

数据库设计案例分析,第1张

'使用方法,在打开窗体时用opendb即可,关闭用closedb,数据库文件你修改dbname变量'表 *** 作 打开 openrs 1,"select * from ..."关闭 closers 1我写了四个表 *** 作变量,1234,你自己看着理解,你要会SQl语句,要不这也没有什么用。'数据库连接:放在一个模块里里面

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数据库营销做的比较久,又有邓白氏商业数据库支持,有不少客户案例分析


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/9929244.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-03
下一篇 2023-05-03

发表评论

登录后才能评论

评论列表(0条)

保存