资源简介

InterBase7.0数据库的建立且与Delphi2010的连接 工程文件 InterBase7.0下载 数据库编辑软件IBExpress下载 等文件下载请见:http://blog.csdn.net/yorkworlddream/article/details/17473913

资源截图

代码片段和文件信息

/*
 *    Program type:  API Interface
 *
 *    Description:
 *        This program creates a new database given an SQL statement
 *        string.  The newly created database is accessed after its
 *        creation and a sample table is added.
 *
 *        The SQLCODE is extracted from the status vector and is used
 *        to check whether the database already exists.
 *
 * The contents of this file are subject to the Interbase Public
 * License Version 1.0 (the “License“); you may not use this file
 * except in compliance with the License. You may obtain a copy
 * of the License at:
 * http://www.borland.com/devsupport/interbase/opensource/IPL.html
 *
 * Software distributed under the License is distributed on an
 * “AS IS“ basis WITHOUT WARRANTY OF ANY KIND either express
 * or implied. See the License for the specific language governing
 * rights and limitations under the License.
 *
 * The Original Code was created by Borland Software Corporation
 * and its predecessors.  Portions created by Borland are Copyright (c)
 * 1994 - 2001 Borland Software Corporation.
 * All rights reserved.
 *
 * Contributor(s):
 *                 Aaron Ruddick Interbase QA Borland Software Corp.
 *                 Dan Mikhayltsa  Interbase QA Borland Software Corp.
 */


#include 
#include 
#include 
#include “example.h“
#include se.h>

int pr_error (long ISC_FAR * char ISC_FAR *);



static char ISC_FAR *create_tbl  = “CREATE TABLE dbinfo (when_created DATE)“;
static char ISC_FAR *insert_date = “INSERT INTO dbinfo VALUES (‘NOW‘)“;

int main (ARG(int argc) ARG(char ** argv))
ARGLIST(int argc)
ARGLIST(char **argv) 
{
    isc_db_handle   newdb = NULL;          /* database handle */
    isc_tr_handle   trans = NULL;          /* transaction handle */
    long            status[20];            /* status vector */
    long            sqlcode;               /* SQLCODE  */
    char            create_db[160];        /* ‘create database‘ statement */
    char            new_dbname[128];

    if (argc > 1)
        strcpy(new_dbname argv[1]);
    else
        strcpy(new_dbname “new.gdb“);

    /*
     *    Construct a ‘create database‘ statement.
     *    The database name could have been passed as a parameter.
     */
    sprintf(create_db “CREATE DATAbase ‘%s‘“ new_dbname);
    
    /*
     *    Create a new database.
     *    The database handle is zero.
     */
    
    if (isc_dsql_execute_immediate(status &newdb &trans 0 create_db 1
                                   NULL))
    {
        /* Extract SQLCODE from the status vector. */
        sqlcode = isc_sqlcode(status);

        /* Print a descriptive message based on the SQLCODE. */
        if (sqlcode == -902)
        {
            printf(“\nDatabase already exists.\n“);
            printf(“Remove %s before running this program.\n\n“ new_dbname);
        }

        /* In add

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2007-09-25 07:52  Interbase7.0\
     文件          45  2002-10-30 11:36  Interbase7.0\AUTORUN.INF
     目录           0  2006-09-20 14:44  Interbase7.0\IBDocs\
     文件       23552  2002-10-30 11:36  Interbase7.0\IBDocs\cfgmgr32.dll
     目录           0  2006-09-20 14:45  Interbase7.0\IBDocs\Doc\
     目录           0  2006-09-20 14:45  Interbase7.0\IBDocs\Doc\Ft3index\
     文件         901  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index.pdx
     目录           0  2006-09-20 14:45  Interbase7.0\IBDocs\Doc\Ft3index\assists\
     文件         773  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\assists\00000000.abt
     文件      181248  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\assists\00000000.wld
     文件        1138  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\assists\00000001.abt
     文件        1138  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\assists\00000002.abt
     文件        1138  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\assists\00000003.abt
     文件        1138  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\assists\00000004.abt
     文件           3  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\assists\acrocat.cat
     目录           0  2006-09-20 14:45  Interbase7.0\IBDocs\Doc\Ft3index\morgue\
     文件           3  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\morgue\acrocat.cat
     目录           0  2006-09-20 14:45  Interbase7.0\IBDocs\Doc\Ft3index\parts\
     文件       16384  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\parts\00000001.ddd
     文件     1148928  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\parts\00000001.did
     目录           0  2006-09-20 14:45  Interbase7.0\IBDocs\Doc\Ft3index\pdd\
     文件        7168  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\pdd\00000000.pdd
     目录           0  2006-09-20 14:45  Interbase7.0\IBDocs\Doc\Ft3index\style\
     文件        1916  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\style\style.ddd
     文件         768  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\style\style.did
     文件         373  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\style\style.pdd
     文件        1767  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\style\style.plc
     文件          31  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\style\style.stp
     文件         561  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\style\style.wld
     目录           0  2006-09-20 14:45  Interbase7.0\IBDocs\Doc\Ft3index\temp\
     文件           3  2002-10-30 11:36  Interbase7.0\IBDocs\Doc\Ft3index\temp\acrocat.cat
............此处省略896个文件信息

评论

共有 条评论