home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 November
/
Pcwk1197.iso
/
LOTUS
/
Eng-ins
/
ACROREAD
/
SUITE
/
DW08_S5.LSS
< prev
next >
Wrap
Text File
|
1996-08-04
|
2KB
|
46 lines
Sub CreateDocument
' * RUNTIME DEPENDENCIES
' * Files and paths: This script depends on an existing dBASE IV
' * database in the directory:
' * C:\LOTUS\WORK\APPROACH\BLANK.DBF
' Declare the necessary variables.
Dim MyConnection As New Connection ' Connection to a table on disk
Dim MyQuery As New Query ' Query used to extract data from
' the table
Dim MyResultSet As New ResultSet ' Result set to contain extracted
' data in the new document
Dim MyDoc As Document ' New document object
' Specify the type of database (dBASE IV) to connect to as the source
' for the new document.
If MyConnection.ConnectTo("dBASE IV") Then
' Specify the name of the connection MyConnection that the
' query MyQuery uses to create the new document.
Set MyQuery.Connection = MyConnection
' Specify the full path and table name to be used as source for
' the new document.
MyQuery.TableName = "C:\LOTUS\WORK\APPROACH\BLANK.DBF"
' Add a statement to specify a subset of records to be returned
' in the result set here. "MyQuery.SQL = ..."
' Specify the result set in the new database to receive the new
' records from the query.
Set MyResultSet.Query = MyQuery
' If the connection and query succeed, create the new document.
If (MyResultSet.Execute)Then
Set MyDoc = New Document(MyResultSet)
End If ' If the result set was successful.
' Error handling for a failed result set would go here.
' Disconnect from the source table.
MyConnection.Disconnect
End If ' If the connection was successful.
' Error handling for a failed connection would go here.
End Sub