When CodeBase first opens a database, if a log file has not yet been opened, CodeBase will look for one called C4.LOG in the current directory and open it if found. This is to prepare for transaction processing. When this error occurs, CodeBase has found such a file, but its contents are invalid. This could be due to a power failure or program crash that occurred during the last time the log file was written to.If the integrity of the log file is important, use CodeUtil (in Windows) or the utility functions (in other operating systems) to repair the log file. Otherwise, simply delete the log file if it is not important.
If you do not intend to use a log file in your application at all, you can force CodeBase to NOT automatically open the log file by calling code4logOpenOff() before you open any database files.
When a CodeBase error is generated in C, C++, Visual Basic or Delphi, CODE4.errorCode (or Code4::errorCode in C++) is set to a negative value to indicate the error that occurred. In order to resume, you must acknowledge the error by setting the errorCode value back to zero.
This problem is common in Windows 95 OEM Service Release 2.x. The source of the problem is the file VREDIR.VXD. Microsoft has provided a new version (210k) for Windows 95 that will fix this problem. The patch executable is a self installing program which will install itself and make the needed changes to your Windows setup.More information on this bug can be found in article Q174371 in the Microsoft Knowledge Base.
There are two common causes of this error:
- The CodeBase Administrator was installed or re-installed after the installation of the CodeControls. This results in the CodeBase Administrator's set of CodeControls, which does not have a design-time license, to be registered, overwriting the registration of the CodeControls with the design-time license. The CodeControl OCX files in the \CodeBase\CodeCtrl directory must be re-registered using the instructions on page 190 of the CodeControl 3 manual.
- The CodeBase 6.5 CodeControls were registered with the wrong set of design-time license files. The correct set of license files can be downloaded from here to replace the existing ones in the \CodeBase\CodeCtrl directory, and then the CodeControl OCX files can be re-registered using the instructions on page 190 of the CodeControl 3 manual.
The current releases of the stand-alone CodeBase SQL/ODBC use their own version of the c4dll.dll. However, the installation program for the driver will not install its c4dll.dll over any pre-existing c4dll.dll in the \Windows\System or \WinNT\System32 directory. The c4dll.dll that is currently in the \Windows\System or \WinNT\System32 directory must be removed, then the stand-alone CodeBase SQL/ODBC must be un-installed and re-installed.
If you are using CodeBase SQL/ODBC on a non-English version of the Windows operating systems, this message may appear. When you do not specify a CodePage for the CodeBase SQL/ODBC to use, it will try to use the CodePage of the operating system. However, if the operating system is not using CodePage 437 or 1252, then this error will occur. Therefore, to avoid this error, you need to specify the CodePage in the connection string of the driver. For instance, "DSN=CodeBaseOdbcStand;UID=;CodePage=437".
There is a change you can make to the Windows registry settings of the driver to increase the number of columns that it returns. Open the Windows Registry Editor, and if you are using the default DSN CodeBaseOdbcStand, go to HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\CodeBaseOdbcStand where you will find several values already there (e.g. DBQ, Locking Attempts). Add a new string value called MaxColSupport, and assign it a number no greater than the limits given for column support in the CodeBase ODBC help file. If you have created your own DSN, you will need to make the change to your DSN's registry settings, located under either HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ or HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\
Windows 9x/ME does not support file locking at large (>4GB) file offsets. To work around this, files should be opened exclusively in CodeBase, so that locking is not required.
This is due to a difference between the compiler options used to build the CodeBase libraries, and the ones you are using to build your application under C++Builder. Specifically, the CodeBase libraries are compiled use the -b compiler option, which causes the compiler to make enumerated data types integer-sized. However, projects created by C++Builder use the -b- compiler option by default, which makes enumerated data types byte-sized.Under C++Builder 4, use the Project|View Makefile menu command to examine the makefile for your project. In the makefile, there is a variable called CFLAG1 that is assigned several compiler options. Change the -b- option to -b, and save the makefile.
Under C++Builder 5, use the Project|Options menu command, and go to the Compiler tab. Under the Compiling section, check the box besides "Treat enum types as ints" and click the OK button.
A number of problems that arise when using Windows NT can be fixed by installing the latest Windows NT Service Pack. The problems that are solved include memory leaks and interaction with NetWare drives.
Sometimes CodeBase will generate a -200 error when opening a file on a NetWare drive. This is solved by downloading an updated Windows Novell Driver.
The NetBEUI driver has been found to work better than other protocols like IPX/SPX when Windows 95 clients are accessing data on a Windows NT server.
When compiling with Microsoft Visual C++, the following error might be generated:This is caused by using the wrong run-time library. For the Release configuration, use the Multithreaded run-time library. For the Debug configuration, use the Debug Multithreaded run-time library.libcimtd.lib(iostrini.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int,int,char const *,int)"
The CodeBase installation program is not always able to register the control COMDLG16.OCX. To register it yourself, use the MSAREG.EXE utility provided in the CODEUTIL\SYSTEM directory.msareg comdlg16.ocx
This error appears when building C4DLL.DLL with Microsoft Visual C++ 4.X with the calling convention set to stdcall. To fix this, go into Build | Settings | C/C++ and change Category to Code Generation. Then change Calling Convention to _cdecl*.
Some UNIX systems require that data in memory is stored on strict byte boundaries. If these boundaries are violated, a system error will usually occur. To ensure that CodeBase adheres to these boundaries, set S4DATA_ALIGN in p4port.h.
This link error is caused by a change in the run-time libraries of Microsoft Visual C++. In version MSVC++ 4.1 and previous, all of the iostream functions were located in LIBC.LIB, LIBCMT.LIB and MSVCRT.LIB. However, with MSVC++ 4.2 and later versions, these iostream functions were moved to their own libraries, called LIBCI.LIB, LIBCIMT.LIB and MSVCIRT.LIB respectively. Because the prebuilt CodeBase libraries for MSVC++ 4.0 were actually built with MSVC++ 4.2, they require the newer run-time libraries. To get around this problem, rebuild the CodeBase libraries using your version of MSVC++ 4.x.
This error message occurs when you try to open the Properties pages of the CodeControls, but there are missing entries in your computer's system registry. You can manually add these missing entries to the system registry by using REGEDIT.EXE. In the MyComputer\HKEY_CLASSES_ROOT\CLSID folder, use Edit | New | Key from the REGEDIT.EXE menu, to add these three keys (the curly braces must be included):When you select any of these keys, the window on the right of REGEDIT.EXE displays its default value. Right click on the word Default, select Modify from the pop-up menu and change the default values of the keys to the following:{0BE35200-8F91-11CE-9DE3-00AA004BB851}
{0BE35201-8F91-11CE-9DE3-00AA004BB851}
{0BE35202-8F91-11CE-9DE3-00AA004BB851}Each of the above keys should have its own subkey called InprocServer32, which can also be created by using Edit | New | Key. The default value of InprocServer32 should be the full path to where MFC40.DLL has been installed on your computer (i.e.. "C:\WINDOWS\SYSTEM\MFC40.DLL" or "C:\WINNT\SYSTEM32\MFC40.DLL"). {0BE35200-8F91-11CE-9DE3-00AA004BB851} - "Font Property Page"
{0BE35201-8F91-11CE-9DE3-00AA004BB851} - "Color Property Page"
{0BE35202-8F91-11CE-9DE3-00AA004BB851} - "Picture Property Page"
There is a mistake in the declaration of report4parent() in CODEBASE.BAS which causes an overflow error when you run your program. Instead of:it should read:Declare Function report4parent% Lib "c4dll.dll" (ByVal r4&, ByVal hWnd%)
The character after the hWnd must be changed from a '%' to a '&' to avoid this error.Declare Function report4parent% Lib "c4dll.dll" (ByVal r4&, ByVal hWnd&)
Visual C++ 6 will work with the pre-built CodeBase 6.4 DLLs.Visual C++ 6 may generate compile errors when rebuilding the CodeBase static library or DLL. If this occurs, download these fixed CodeBase 6.4 source files and place them in your SOURCE directory.
Visual C++ 6 will work with CodeControls 3, but the example projects for Visual C++ 5 that come with CodeBase 6.4 will not work with Visual C++ 6. These example projects have been updated for Visual C++ 6.
Two example source files will not compile with Visual C++ 6. These example source files have been updated to work.
A GPF can occur while running the CodeBase 6.4 install program. It occurs when the Browse button in the "Choose Destination Location" window is pressed. There are two solutions to this problem:
- Restart the computer and run the installation program again before running any other programs. Do not click the Browse button; you will not be able to modify the directory CodeBase is installed to.
- Copy the files directly from the CD. The files on the CD are not compressed, so they can be copied directly to your hard drive. Stand-alone support can be found in the CB65 directory, and client/server support can be found in the CB65CS directory. NOTE: If you wish to use CodeControls, you will have to manually register the OCX files with REGSVR32.EXE.
This error can sometimes be resolved by re-building the CodeBase client library with the E4OFF_STRING compiler switch. This should free up approximately 40K in your default data segment. With this switch set, CodeBase error messages will only output error numbers, without any text information about the error. You can cross reference the error message by looking up the error numbers in E4STRING.C.
The following solution will allow CodeBase client applications to access the CodeBase server through WinProxy 2.1 under these conditions:
In WinProxy 2.1, create settings
to redirect CodeBase client communication to the server. Open the File
menu. Select Advanced Properties. Select the Mapped Port
tab. Press the New button.
|
|
|
||
|
|
|
|
|
| Data File |
|
|
|
| Memo File |
|
|
|
| Index File |
|
|
|
Data File: A file with the DBF extension. It contains all the non-memo entries.
Memo File: A file with either a DBT or FPT extension. It contains all memo entries.
Group File:A file with a CGP extension. This file is unique to CodeBase and is used only in the Clipper case. It contains the names of the index files.
Index File:A file with a CDX, MDX or NTX extension. This file contains the sort order of the data file.
For further information about the contents of the above files, please consult other questions in this document or the User's and Reference Guides.
What is the difference between opening a file in read-only mode, and opening the file in exclusive mode?
How can files be opened in different modes?
|
CODE4.accessMode |
I get an error after opening several files simultaneously. However, if I first close some files, and then open the rest, everything is fine.
See Also: Error -20, Error -30
When I change my database on one workstation, who do the changes not appear on another workstation and I receive errors?
Why do I have trouble with relations when I am using two files that have the same name, even if they are in different directories?
Let us assume that we have two files called C:\DIR1\FILE.DBF and C:\DIR2\FILE.DBF. Click below for a short program segment that will open both files.
The following information should be understood when using memo fields:
If I search for the string "JOHN", I get a return code of 0 (r4success in Appendix B), yet I am positioned on record "JOHNSON". How do I perform an exact match and find only "JOHN" ?
How can I perform a case-insensitive search?
What is the difference between a TAG and an INDEX?
Suppose we have a database with two fields, NAME and ID. If we want to sort the database according to the NAME field then we set up a TAG (sort order) based on the NAME field. Similarly, if we want to sort on the ID field we can create a TAG based on the ID field. If we want to search and skip through the database using the alphabetized name tag, we must select the NAME tag using the "tag select" command. We may do the same for the ID numbers.
In order to store the TAGs on disk, xBASE (which includes CodeBase) uses INDEX files. CDX and MDX INDEX files may contain several tags. However, NTX INDEX file only contain a single tag. Once we open an INDEX file, we have access to all the tags that are associated with the index.
When I try to open my DBF, I get an error #-60: "Unable to open XXX.CGP." What is a .CGP file?
Also, please refer to "Group Files" in the CodeBase manuals.
CGP files are unique to CodeBase
and exist only in the cases when S4CLIPPER is defined. Because Clipper
(NTX) does not have multiple-tag index files, CodeBase implements a CGP
file which emulates this functionality. A CGP file allows you to open your
NTX files as if they are a part of a multiple index. For instance, if you
have two NTX files called TAG1.NTX and TAG2.NTX, you may either open each
individually, or use a CGP file and open the two files as if they were
a single index file. Below is an example CGP file that contains a reference
to the above index files:
If a CGP file is not used then each index file must be opened manually. Refer to the example programs NOGROUP1 and NOGROUP2 in the User's Guide.
How are indexes in a non-default directory and indexes with non-standard name extensions used with CodeBase?
For those using Clipper compatibility, the index file name passed to i4create() or i4open() (Index4::create() or Index4::open() in C++) is the name of the CGP file. The individual index files will still each have the .NTX file extension. To create Clipper indexes with a non-default extension, you can specify the extension name when defining the TAG4INFO.name element for any given index.
An alternate way to specify non-default Clipper extensions is to manually modify an existing CGP file and its associated index files.
For example, if the required file names are DATAFILE.ABC (instead of DATAFILE.CGP), TAG1.ABC (instead of TAG1.NTX), and TAG2.XYZ (instead of TAG2.NTX) you could perform the following steps:
If a CGP file is not used then t4open must be used instead. Remember that the path names must be included.
Why are all unique tags set to r4uniqueContinue, even though they were created with the r4unique option?
In the xBASE format, the only information stored to disk about a tag's uniqueness is a Boolean value that indicates whether the tag is unique or non-unique. There is no place in the tag to store more detailed information, such as whether unique tags should be handled in a fashion similar to r4unique vs. r4uniqueContinue.
In addition, the default behavior for dBASE, FoxPro and Clipper is to maintain unique tags in a manner similar to that used by CodeBase when the tag is set to r4uniqueContinue.
Consequently, in order to be compatible with their tag formats, CodeBase sets the default behavior for any unique tag to r4uniqueContinue, even if the tag was originally created with the r4unique setting. CodeBase accomplishes this be maintaining an internal structure for each tag. When the index file containing the tag is opened, CodeBase sets a specific 'unique' member of the structure to r4uniqueContinue. The possible values of this member are as follows:
|
|
|
| 0 | Duplicate keys are allowed in the tag. |
| e4unique | When a duplicate key is created, via the appending of a new record or the modification of an existing record, it is not added to the tag, and an e4unique error is generated by the CodeBase function that updated/appended the record. The record is not updated. |
| r4unique | Same as e4unique, except no error message is generated, and the CodeBase function returns r4unique instead of e4unique. |
| r4uniqueContinue | When a duplicate key is created via the addition or modification of a record, the key for that record is not added to the tag, although the record containing the duplicate key is allowed to be added/updated in the data file. The CodeBase function that created the duplicate key record returns r4unique to let you know that the key was a duplicate. |
The default unique error-handling behavior for a tag is determined by the setting of the CODE4.errDefaultUnique member. If you wish to change the default setting for all tags that are opened, modify this member with one of the values listed above. The default value of this member is r4uniqueContinue.
See also: i4create (Index4::create() in C++).
| Record Number | NAME |
| 1 | AAA |
| 2 | BBB |
| 3 | BBB |
The TAG4INFO settings used when the tag was created was as follows:
| Name | TAG_NAME |
| Expression | NAME |
| Filter | none |
| Unique | r4uniqueContinue |
| Descending | 0 |
In this case, the tag's uniqueness was set to 'r4uniqueContinue'. This setting tells CodeBase to allow the update or appending of a record with a duplicate key (such as record 3), but not to add an entry for that record in the index tag.
Therefore, based on the above data file, only keys for records 1 and 2 are included in the tag; there is no entry for record 3. Later, the NAME field of record 2 is changed to 'CCC'. At this point, the 'BBB' value in record 3 would no longer be a duplicate value, and you would expect all three records to appear in the index tag. But it is not. Record 3 does not have a tag entry.
Answer: For performance reasons, it is not possible for CodeBase to scan the entire data file searching for a possible record that can now be included in the index due to the modification of an existing record.
The only available work-around to this problem would be to delete the duplicate-key record, and then re-append the information to the data file, thus updating the index file tag. The best solution to this problem is not to use r4uniqueContinue on indexes where this situation might occur; instead use r4unique or e4unique.
Note also, this if you do not update the index (by removing the record and adding it back in), you will end up with a corrupted index file.
To find out the number of records in an index, just select the required index, go to the top, and skip to the bottom. Count the number of skips and add one. This number will correspond to the number of valid records in the index.
| Name | Type | Length | Decimals |
| AGE | r4num | 2 | 0 |
| WEIGHT | r4num | 5 | 1 |
the tag expression to join the two
would be:
Take note of the spaces embedded in the search string above. These spaces are required to match the search value with the size of the two fields that make up the index key expression (2 + 5).
Note also that even though this is a character tag, which is normally left justified, because the expression is based on numerical fields -- which are always right justified -- the individual sub-expressions within the tag expression are also right justified.
See also: Expression
For example, 2:51 pm on December 6, 1999 would be formatted as "1999120614:51:00.000".
Let us assume the following tags
have been defined:
| Name | Expression | Filter | Unique | Descending |
| TAG1 | FLD1 | "" | 0 | 0 |
| TAG2 | FLD2 | "" | 0 | 0 |
| TAG3 | FLD3 | ".NOT. DELETED" | 0 | 0 |
| TAG4 | FLD4 | "DELETED() .OR. .NOT. DELETED()" | 0 | 0 |
| TAG5 | FLD5 | "" | 0 | r4descending |
| TAG6 | FLD6+FLD7 | "" | 0 | 0 |
| TAG7 | FLD7 | "" | r4uniqueContinue | 0 |
Why can QO not use a r4uniqueContinue tag?
See Also: Query Optimization, r4unique, r4uniqueContinue
When the relation matches master to slave, only one slave is matched to a master at one time.Here is an example:
name.dbfID F_NAME L_NAME 1 JOHN BROWN
phone.dbfID PHONE_NUM 1 444-5555 1 555-4444
internet.dbfID E_MAIL 1 john@abc.com 1 jbrown@xyz.com 1 jb@isp.com Both internet and phone are slaves of name. So name relates to phone; and name relates to internet. But internet and phone do not relate to each other.
Assuming there is no query, as you skip through the relation, the records will look like this:
NAME PHONE_NUM E_MAIL JOHN BROWN 444-5555 <BLANK> JOHN BROWN 555-4444 <BLANK> JOHN BROWN <BLANK> john@abc.com JOHN BROWN <BLANK> jbrown@xyz.com JOHN BROWN <BLANK> jb@kkk.com If you create a query such as "PHONE_NUM = '444-5555' .AND. E_MAIL = 'john@abc.com'", you would not find any records.
How can fields from different files be referenced in a query?
Is it possible to have a master file with multiple relations to the same slave file?
See also: Alias, Query
By using code4calcCreate, the ability to create longer expressions than would otherwise be possible is gained.
In this particular example, a -440 error will be generated if the call to expr4parse is made with more than 19 comparisons. That is, if the expression "FIELD1=1 .OR. FIELD1=2 .OR. ... .OR. FIELD1=20" is passed, then the above error will be generated. Consequently, the code4calcCreate could be used for the first 19 comparisons and the query would be called as "MYEXPR() .OR. FIELD1 = 20."
See also: expr4parse, relate4querySet, Error -440
In this example, there are three fields in the table: FNAME, LNAME, CITY and COUNTRY. The query expression is "LNAME + FNAME + COUNTRY + CITY". Here is the pseudocode that will break this up:
exName = expr4parse(data,"LNAME
+ FNAME")
exPlace = expr4parse(data,"COUNTRY
+ CITY")
code4calcCreate(cb,exName,"NAME")
code4calcCreate(cb,exPlace,"PLACE")
relate4querySet(relate,"NAME()
+ PLACE()")
The expression is now broken down into two smaller expressions which are each made into a dBASE function. The query expression uses those functions and is shorter than what we had before.
| Name | Type | Length | Decimals |
| NAME | r4num | 10 | 0 |
| BIRTH | r4date | 8 | 0 |
| WEIGHT | r4num | 6 | 2 |
| MARRIED | r4log | 1 | 0 |
In order to concatenate any of the fields together, the rules below should be applied:
In order to create an expression which uses all of the above fields, the following sequence may be used:
How is a query with a date field made?
| Name | DUE_DATE |
| Type | r4date |
| Length | 8 |
| Decimals | 0 |
To find all the records with a DUE_DATE of April 24, 2001, use one of the following queries:
See also: Expression
Pinging server5.network.com [217.53.30.5] with 32 bytes of data: Reply from 217.53.30.5: bytes=32 time<10ms TTL=128 Reply from 217.53.30.5: bytes=32 time<10ms TTL=128 Reply from 217.53.30.5: bytes=32 time<10ms TTL=128 Reply from 217.53.30.5: bytes=32 time<10ms TTL=128
If you do not get a host name before the IP address on the first line of the reply (server5.network.com in this example), PING cannot locate the necessary resources to resolve an IP address to a host name. See the Appendix on Protocols in your Getting Started book or contact your network administrator.
Can I speed up the time it takes to display a sorted report? I am using the Report | Sort Expression dialog box.
How is it possible to calculate a total without showing it on the screen?
Another possible solution is to set the font color of the 'TOTAL' object to be identical to the background color. However, this will not work for a DOS report.
Lastly, you may create the 'TOTAL' object and set the object size to 0.
The next step is done from the program itself. When printing reports from DOS, it is recommended that the page be reset. The following commands should be called before report4do:
See also: d4aliasSet, d4openClone
Back to the Sequiter Tech Support Page