Difference between revisions of "Dbclose()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 11: | Line 11: | ||
<input parameter> | <input parameter> | ||
− | char *dbf; /* Database file descriptor */ | + | char *dbf; /* Database file descriptor */ |
<output parameter> | <output parameter> | ||
Line 35: | Line 35: | ||
<code lang="c"> | <code lang="c"> | ||
#include "dbl.h" | #include "dbl.h" | ||
− | char *dbf; /* .DBF file descriptor */ | + | char *dbf; /* .DBF file descriptor */ |
− | int rc; /* Return code | + | int rc; /* Return code */ |
rc = dbclose(dbf); | rc = dbclose(dbf); | ||
− | if (rc = = SUCCESS) printf("database closed n"); | + | if (rc = = SUCCESS) printf("database closed \n"); |
else { | else { | ||
− | printf("error number %d n"); | + | printf("error number %d \n"); |
exit (1); | exit (1); | ||
} | } |
Revision as of 15:48, 3 April 2009
PURPOSE
close database file
SYNOPSIS
#include "dbl.h" int dbclose(dbf) <input parameter> char *dbf; /* Database file descriptor */ <output parameter> none
RETURN VALUE
The dbclose() function returns 0 for success, or < 0 if an error occurs. See the section on return code values for a detailed list of return codes.
DESCRIPTION
The dbclose() function is used to close the specified database (.DBF) file in the file descriptor.
EXAMPLE
The following example closes a .DBF file whose file descriptor is in "char *dbf;".
#include "dbl.h" char *dbf; /* .DBF file descriptor */ int rc; /* Return code */ rc = dbclose(dbf); if (rc = = SUCCESS) printf("database closed \n"); else { printf("error number %d \n"); exit (1); }