Article ID 1840
Article Title INFO: Open Methods when Using CLI Connectivity Kits
Article URL http://www.dataaccess.com/kbasepublic/kbprint.asp?ArticleID=1840
KBase Category Connectivity
Date Created 06/23/2003
Last Edit Date 07/06/2003


Article Text
QUESTION:
I know we can use two different types of filelist entries to open a converted file but I wanted to confirm some information:

The 2 alternatives are
- INT (Syntax: FILENAME.INT)
- Driver prefix (Syntax: DRIVERNAME:FILENAME)

1) Is the driver prefix syntax correct?
2) Do we need INT file if we use the driver prefix?
3) How does the driver know about information like relationships -- use INT?
4) What is the advantage of opening files with driver prefix?


ANSWER:
1) Yes the syntax is correct

2) You can use it with and without an INT file. If there is an INT file, you would do something like:
     Open "DB2_DRV:Customer" As hTable
   Without an INT you would do:
    Open "DB2_DRV:MySchema#customer@DSN=MyDB;UID=db2admin;PWD=MyPwd"
to open table customer in schema MySchema in database MyDB logging in as db2admin (the schema name is not required) using password MyPwd.

3) If you use an INT, the relationship information is in the INT. If you do not use an INT, there is no relationship information.

4) If you are using INT files, driver prefix is faster. Another advantage is that the driver prefix allows you not to use INT files at all if you do not want to -- like the second example in item 2).
So,
   Open "DB2_DRV:Customer" As hTable
is faster than
   Open "Customer.int" As hTable


Note1:
If the CK being used is ODBC, the driver prefix should be used like ODBC_DRV:filename. If the CK being used is Microsoft SQL Server, use MSSQLDRV:filename. If it is DB2, use DB2_DRV:filename.

Note2:
After converting data files to any CLI CK backend, the filelist will have entries converted to the standard INT syntax. To use the driver prefix, you should edit the filelist entries accordingly.

Note3:
When you do
OPEN "DB2_DRV:Customer" as CUSTOMER

it doesn't matter what you have specified as rootname in the filelist. What happens is that the filenumber of CUSTOMER will be used to open "DB2_DRV:Customer" -- the same is true for non-CK (DataFlex) files.

That "open as" is the kind that uses INT file -- check item 2). So, whatever relationships you have specified in the INT will be used by the CK.

Remember: you can have the rootname of that filelist entry changed to "DB2_DRV:Customer" and then you just use a regular Open (Open CUSTOMER) to open "DB2_DRV:Customer".




Contributed By:
Ben Weijers
Company: Data Access Worldwide
Web Site: http://www.dataaccess.com


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2024 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.