SetDS
Description
Initializes the data source object from another data source object or from a string.
Syntax
Function SetDS( ds )
Parameters
variant ds - the datasource prototype
string - a file path to the database resource for file based databases;
object - an initialized DS object from which to copy the settings
Return Values
none
Examples
You can set output table using two methods:
setting the table name (assuming you are connected to a database) - (a)
setting the entire data source - (b):
If you are writing script outside TextConverter the API looks like this:
Set DS = TextConverter.GetOutputDS()
DS.table = "tablename" ) ‘- (a)
DS.SetDS( "c:\data\output.dbf" ) ‘- (b)
If you are writing script inside TextConverter it looks like this:
This.DSOut.table = "tablename" ) ‘- (a)
This.DSOut.SetDS( "c:\data\output.dbf" ) ‘- (b)
An Excel file is also considered as a database, so you can set the worksheet as:
Set DS = TextConverter.GetOutputDS()
DS.table = "worksheetname" ) ‘- (a)
DS.SetDS( "...\file.mdb:worksheetname" ) ‘- (b)
Additional examples:
'Sample 1
DS.SetDS( ds1 ) 'ds1 - pre initialized data source object
'Sample 2
DS.SetDS( "c:\data\access.mdb" )
DS.table = "Table1"
'Sample 3
DS.SetDS( "c:\data\input.csv" )