|
ERRCODE TFormer_SetODBCData |
( |
HTFORM |
pInstance, |
|
|
LPCSTR |
pszDSN, |
|
|
LPCSTR |
pszUser, |
|
|
LPCSTR |
pszPwd, |
|
|
LPCSTR |
pszSQLSelect | |
|
) |
| | |
Specifies an ODBC DataSource.
- Returns:
- - ErrOk (0) in case of success
- Non-zero if error occurred
- Parameters:
-
[in] | pInstance | The TFORMer-Instance provided by a previous call to TFormer_Init. |
[in] | pszDSN | DSN for ODBC-Connection |
[in] | pszUser | User-Name for ODBC-Connection |
[in] | pszPwd | Password for ODBC-Connection |
[in] | pszSQLSelect | Select statement for fetching the data. Column names are treated as DataField names. |
- Note:
- Behavior if no input data was supplied: If no DataSource was specified (either by TFormer_SetXXXDataFile, TFormer_SetODBCData or via TFormer_NewRecord and TFormer_SetVarValue) the default data-file (located in the same directory as the FormLayout itself and generated by the last TFORMer Designer session) is used. If this default data-file does not exists no output will be produced. The name of the default data-file is
path/FormName.xml .
This example demonstrates how to use the pre-installed ODBC DataSource (named TFORMer_Sample) for generating a report as PDF. The table tbl_Example looks like follows:
Sample Table
ChapterNumber | Caption | Pagenumber |
1 | Content | 2 |
1.1 | Table of Figures | 6 |
1.2 | List of Tables | 6 |
2 | Disclaimer | 7 |
... | ... | ... |
- See also:
- TFormer_SetTxtDataFile, TFormer_SetXmlDataFile, TFormer_SetImportFieldForRecordCopy.
|