home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form form1
- Caption = "Form1"
- ClientHeight = 6030
- ClientLeft = 1095
- ClientTop = 1515
- ClientWidth = 6720
- Height = 6435
- Left = 1035
- LinkTopic = "Form1"
- ScaleHeight = 6030
- ScaleWidth = 6720
- Top = 1170
- Width = 6840
- Begin VB.CommandButton cmdcache
- Caption = "&Cache"
- Height = 495
- Left = 1560
- TabIndex = 5
- Top = 4560
- Width = 1215
- End
- Begin VB.CommandButton cmdlogmessages
- Caption = "&Log Messages"
- Height = 495
- Left = 120
- TabIndex = 4
- Top = 4560
- Width = 1215
- End
- Begin VB.CommandButton cmdexequtesql
- Caption = "&Execute SQL"
- Height = 495
- Left = 4560
- TabIndex = 3
- Top = 5280
- Width = 1275
- End
- Begin VB.CommandButton cmdcreaterecordset
- Caption = "&Create Recordset"
- Height = 495
- Left = 3060
- TabIndex = 2
- Top = 5280
- Width = 1275
- End
- Begin VB.CommandButton cmdregister
- Caption = "&Register DataBase"
- Height = 495
- Left = 1560
- TabIndex = 1
- Top = 5280
- Width = 1275
- End
- Begin VB.CommandButton cmdopenodbc
- Caption = "&Open ODBC"
- Height = 495
- Left = 120
- TabIndex = 0
- Top = 5280
- Width = 1215
- End
- Attribute VB_Name = "form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub cmdcache_Click()
- Dim db As Database
- Dim ws As Workspace
- Dim sconnect As String
- Dim rs As Recordset
- Set ws = DBEngine.CreateWorkspace("ws1", "ADMIN", "")
- ' Now open the DataBase
- Set db = ws.OpenDatabase("BIBLIO", False, False, "ODBC;" & sconnect)
- Set rs = db.OpenRecordset("select * from titles", dbOpenDynaset, dbSQLPassThrough)
- rs.CacheSize = 25
- rs.CacheStart = rs.Bookmark
- rs.FillCache rs.CacheSize, rs.CacheStart
- End Sub
- Private Sub cmdcreaterecordset_Click()
- Dim db As Database
- Dim ws As Workspace
- Dim sconnect As String
- Dim rs As Recordset
- ' Now open the DataBase
- Set ws = DBEngine.CreateWorkspace("ws1", "ADMIN", "")
- sconnect = "DataBase= BIBLIO,UID=ADMIN,PWD=Admin"
- Set db = ws.OpenDatabase("BIBLIO", False, False, "ODBC;" & sconnect)
- Set rs = db.OpenRecordset("select * from titles", dbOpenDynaset, dbSQLPassThrough)
- End Sub
- Private Sub cmdexequtesql_Click()
- Dim db As Database
- Dim ws As Workspace
- Dim sconnect As String
- Dim rs As Recordset
- Dim nrows As Long
- Dim csql As String
- ' Now open the DataBase
- Set ws = DBEngine.CreateWorkspace("ws1", "ADMIN", "")
- sconnect = "DataBase= BIBLIO,UID=ADMIN,PWD=Admin"
- Set db = ws.OpenDatabase("BIBLIO", False, False, "ODBC;" & sconnect)
- Set rs = db.OpenRecordset("select * from titles", dbOpenDynaset, dbSQLPassThrough)
- csql = " update titles set notes = 'Test Notes' "
- nrows = db.ExecuteSQL(csql)
- End Sub
- Private Sub cmdlogmessages_Click()
- Dim ws As Workspace
- Dim db As Database
- Dim qrynew As QueryDef
- Dim rstitles As Recordset
- Dim propmessages As Property
- Dim sconnect As String
- Set ws = DBEngine.CreateWorkspace("title", "Admin", "")
- Set db = ws.OpenDatabase("BIBLIO", False, False, "ODBC;" & sconnect)
- ' Create a New QueryDef
- Set qrynew = db.CreateQueryDef("new", "Select * from titles where pubid = 13")
- ' Set the connect information for the Query
- sconnect = "DataBase= BIBLIO,UID=ADMIN,PWD=Admin"
- qrynew.Connect = sconnect
- ' Load The Recordset based on the New Query
- Set rstitles = db.OpenRecordset("new", dbOpenDynaset)
- Set propmessages = qrynew.CreateProperty("logmessages", dbBoolean, True, False)
- ' Save the Property definition
- qrynew.Properties.Append propmessages
- ' Set the Query to Log messages
- qrynew.logmessages = True
- End Sub
- Private Sub cmdopenodbc_Click()
- Dim db As Database
- Dim ws As Workspace
- Dim sconnect As String
- Set ws = DBEngine.CreateWorkspace("ws1", "ADMIN", "")
- sconnect = "DataBase=BIBLIO;UID=ADMIN;PWD="
- Set db = ws.OpenDatabase("BIBLIO", False, False, "ODBC;" & sconnect)
- End Sub
- Private Sub cmdregister_Click()
- Dim db As Database
- Dim ws As Workspace
- Dim sconnect As String
- sconnect = "network1"
- DBEngine.RegisterDatabase "BIBLIO", "ORACLES", True, sconnect
- ' Now open the DataBase
- Set ws = DBEngine.CreateWorkspace("ws1", "ADMIN", "")
- sconnect = "DataBase= BIBLIO,UID=ADMIN,PWD=Admin"
- Set db = ws.OpenDatabase("BIBLIO", False, False, "ODBC;" & sconnect)
- End Sub
-