Linker IT Software
Order Home
menubar-top-links menubar-top-rechts

SQL*XL: Database to Excel bridge

Related LIT software: litLIB: Excel power functions pack encOffice: Protect your Excel file easy and safe

Home Products SQL*XL Help VBA SQLXL Targets Target

Buy now

Download now

SQL*XL online help


SQL*XL API: TargetText Object

TargetText Object


Class clsTargetText is a subclass of:



The TargetText object implements the functionality to output data from SQL*XL to a flat file. You may use any or no field separator. The properties of TargetText determine the way data is output to the plain text file. To obtain a reference to the TargetText object use the Targets property of the SQLXL object. Example: SQLXL.Targets( litText ).Headings = False

Physically, output is generated by the Statement objects notably the StmtDQL object that implements select statements. The execute method of the Statement outputs the data according to the setting of the Target property on the Statement. If Statement.Target = litText then output will be generated as a plain text file.


Name Data Type Description
FileName As String File name for the new text file. (Full path!)
FieldSeparator As String Character or string to separate the database field. Set to "," for a CSV file, set to a vbTab for a tab delimited file, etc.



Create a CSV output file:

SQLXL.SQL.setText Text := "select * from emp"
Set SQLSL.SQL.Statements(1).Target= Targets(litText )
Targets(litExcel).FileName = "c:\test.csv"
Targets(litExcel).FieldSeparator = ","

Note: Please record all code through the macro recorder.

SQL*XL ribbon in Excel