contents.gifindex.gifprev1.gifnext0.gif

ODBC: Common Questions and Answers

Question: I can't seem to get Acu4GL to create the files via ODBC. They keep coming up as Vision files.

Answer: Check to see that the DEFAULT-HOST variable is set in the runtime configuration file or the environment. Setting DEFAULT-HOST in the environment overrides the setting in the runtime configuration file.

Type wrunod32 -vv (for ACUCOBOL-GT Version 4.1 or later, 32-bit runtime, respectively), and make sure that the version number of the ODBC interface is reported. This tells you that the interface has been installed successfully. If -vv does not return the ODBC interface information, make sure the linked runtime has the name you used, and is the first so-named executable on the PATH.

If you cannot locate a runtime that displays an ODBC interface version number using -vv, you will have to create one by relinking the runtime. If you are unsure about the relinking process, contact Acucorp Technical Support.

Question: Can I use both ODBC and Vision at the same time?

Answer: Yes, you can. In the runtime configuration file, set DEFAULT-HOST to the file system you want the runtime to use automatically. Then, for selected files, assign them to an alternate file system with the variable filename-HOST. For example, to put CUSTFILE into ODBC and everything else into Vision, you would add:

DEFAULT-HOST Vision
CUSTFILE-HOST ODBC

Question: How can I find out what the ODBC error message is?

Answer: If you run your application with the -x option, you will receive secondary error numbers that include those returned by ODBC, in addition to the ACUCOBOL-GT error.

If you have sent the errors to an output file with the -e option, the runtime will also attempt to include the text that explains the errors. See Troubleshooting for additional details.

You can also retrieve error codes from within your COBOL program by using library routine C$RERR. See the Troubleshooting topic for additional details.

Question: Do my XFD files have to be in the same directory as my object files?

Answer: No. You can instruct the compiler to put the XFD files in a directory other than the current one with the -Fo option, or you can move the XFD files after they're created. Then at runtime, make sure you have the runtime configuration file variable XFD-DIRECTORY set to that same directory.

Question: Why aren't my keys being retrieved in the correct order?

Answer: You may have illegal data in the field. For example, if you've used LOW-VALUES or HIGH-VALUES in a numeric key to mark control records, those values are considered invalid and can cause the records containing them to be retrieved in an unexpected sequence.

Signed numeric data in key fields can also be a problem; the records may not sort, or be retrieved, in the same sequence as under the Vision file system.

To enable special values such as these to be processed, use the BINARY directive in front of the key field. This will allow data of any classification to be processed. Either designate an individual field as binary, or specify USE GROUP, BINARY in front of a group of fields.

Question: Can I open tables in different databases and share the data?

Answer: Yes. But you must set up the data sources one at a time, as described in this topic. For example, you could first set your data source to be Oracle and open Oracle tables, and then you could change the data source to Access and open Access tables.

Remember, you can set up data sources dynamically at runtime by adding a line like this before the statement that opens the file:

SET ENVIRONMENT "A-ODBC-DATASOURCE " TO "data source name"

Question: I keep receiving an error message saying that my login is invalid. But I'm sure I'm using the correct username and password.

Answer: All usernames, passwords, and database names are case sensitive. Be sure that you are typing the names exactly as they are set up.

Question: I'm using Microsoft Access version 2.0, and I'm having trouble accessing/writing tables from my ACUCOBOL-GT program.

Answer: Check the version of the Access driver you are using. Microsoft Access version 2.0 requires version 2.0 of the driver. If you are using a previous version of the driver, the runtime will generate errors. To determine the version number of your driver, you can run the Acu4GL for ODBC driver test program DRVTST32.EXE (32-bit version).

Question: I'm noticing some performance degradation when accessing my ODBC data source. What is the cause of this?

Answer: You may notice some performance impact if you were previously accessing Vision indexed files directly. This is because ODBC adds a software layer between your applications and your data sources. In return for minor performance impact, you can reap the benefits of database independence and enhanced portability. Overall performance depends on several factors, including your network configuration and your specific data source.

Question: I wrote data with my Acu4GL for Oracle (or Informix) interface. When I try to read it with Acu4GL for ODBC, the data is not the same.

Answer: By necessity, the BINARY data type is implemented differently in Acu4GL for ODBC than it is in Acu4GL for Oracle or Informix. For this reason, writing data with one interface and then reading it with another will probably produce different results. Future releases of Acu4GL for Oracle and Informix will address this problem.

Question: When I create a table, I get an error saying I have placed too many BLOBs (binary large objects) in my table.

Answer: Some databases have restrictions about the number of BLOBS that can be placed into a single table. To work around this restriction, you can specify the configuration variable A-ODBC-USE-CHAR-FOR-BINARY. This allows you to encode binary data in hexadecimal and write it out as CHAR data instead of BINARY. Refer to the ODBC: Configuration File Variables topic for more information on this variable.

This is the end of the Acu4GL for ODBC section. Click the Contents button at the top of this window to return to the Table of Contents page.