Import Method

Applies To:

Document object

Description:

Imports Structure Data (SDFiles) and Reaction Data (RDFiles) files directly into a database.

Syntax:

Document.Import ( BSTR/String importFilename,BSTR/String targetFilename, 
BSTR/String logFilename, CFTargetAction targetAction, 
CFDuplicateAction duplicateAction
)
importFilename 
Name and path of file to import.
targetFilename Destination database for incoming data.
logFilename  Name of text log file that records all additions and deletions during  importing.
targetAction One of three modes of importing into target.
duplicateAction If a structure being imported is already on file in the target database, one of the three values tells ChemFinder what to do.

Remarks:

targetAction values:

kCFAppend

Adds imported data to end of existing database without changing pre-existing data.

kCFMerge  

Combines imported and pre-existing data.

kCFOverwrite  

Replaces existing data with imported data.
duplicateAction flags:

kCFAppendData

Concatenates incoming and pre-existing text data. This option is not available for numeric data; incoming numeric data always replaces existing.

kCFReplaceData

Replaces only existing data of the same type as incoming data. Existing data of other types remain untouched.

kCFSkipData 

Ignores any incoming data of same type as any existing data. Existing data of same type remains untouched.

Example:

The following VB code would be typical:

Dim FinderDoc As Object    'Document
Dim ImportFile As String      'Input file
Dim LogFile As String          'Import log
Dim TargetFile As String      'Target database

ImportFile = "D:\Program Files\ChemOffice\ChemFinder\samples\sample.sdf"
LogFile = "D:\Program Files\ChemOffice\ChemFinder\samples\Sample.log"
TargetFile = "D:\Program Files\ChemOffice\ChemFinder\samples\sample.mdb"

'Import
FinderDoc.Import ImportFile, TargetFile, LogFile, kCFMerge,                     kCFSkipData

'Code required to create FinderDoc is omitted

See Also:



2005 CambridgeSoft Corporation. All Rights Reserved. Privacy Statement
Tel  800 315-7300 / 617 588-9300     Fax  617 588-9390     Email   info@cambridgesoft.com
CambridgeSoft Corporation, 100 CambridgePark Drive, Cambridge, MA 02140 USA