����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/*
* 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.Inprise.com/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 Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "example.h"
#include <ibase.h>
int pr_error (long *, char *);
static char *create_tbl = "CREATE TABLE dbinfo (when_created DATE)";
static char *insert_date = "INSERT INTO dbinfo VALUES ('NOW')";
int main (int argc, char** argv)
{
isc_db_handle newdb = NULL; /* database handle */
isc_tr_handle trans = NULL; /* transaction handle */
ISC_STATUS_ARRAY status; /* 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.fdb");
/*
* 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 addition, print a standard error message. */
if (pr_error(status, "create database"))
return 1;
}
isc_commit_transaction(status, &trans);
printf("Created database '%s'.\n\n", new_dbname);
/*
* Connect to the new database and create a sample table.
*/
/* newdb will be set to null on success */
isc_detach_database(status, &newdb);
if (isc_attach_database(status, 0, new_dbname, &newdb, 0, NULL))
if (pr_error(status, "attach database"))
return 1;
/* Create a sample table. */
isc_start_transaction(status, &trans, 1, &newdb, 0, NULL);
if (isc_dsql_execute_immediate(status, &newdb, &trans, 0, create_tbl, 1, NULL))
if (pr_error(status, "create table"))
return 1;
isc_commit_transaction(status, &trans);
/* Insert 1 row into the new table. */
isc_start_transaction(status, &trans, 1, &newdb, 0, NULL);
if (isc_dsql_execute_immediate(status, &newdb, &trans, 0, insert_date, 1, NULL))
if (pr_error(status, "insert into"))
return 1;
isc_commit_transaction(status, &trans);
printf("Successfully accessed the newly created database.\n\n");
isc_detach_database(status, &newdb);
return 0;
}
/*
* Print the status, the SQLCODE, and exit.
* Also, indicate which operation the error occured on.
*/
int pr_error (long* status, char* operation)
{
printf("[\n");
printf("PROBLEM ON \"%s\".\n", operation);
isc_print_status(status);
printf("SQLCODE:%d\n", isc_sqlcode(status));
printf("]\n");
return 1;
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| api1.c | File | 4.18 KB | 0644 |
|
| api10.c | File | 5.88 KB | 0644 |
|
| api11.c | File | 5.63 KB | 0644 |
|
| api12.c | File | 10.63 KB | 0644 |
|
| api13.c | File | 5.65 KB | 0644 |
|
| api14.e | File | 6.14 KB | 0644 |
|
| api15.c | File | 6.6 KB | 0644 |
|
| api16.c | File | 6.36 KB | 0644 |
|
| api16t.c | File | 5.04 KB | 0644 |
|
| api2.c | File | 4.67 KB | 0644 |
|
| api3.c | File | 4.52 KB | 0644 |
|
| api4.c | File | 4.46 KB | 0644 |
|
| api5.c | File | 3.74 KB | 0644 |
|
| api6.c | File | 7.19 KB | 0644 |
|
| api7.c | File | 5.4 KB | 0644 |
|
| api8.c | File | 4.74 KB | 0644 |
|
| api9.c | File | 4.87 KB | 0644 |
|
| api9f.c | File | 7.08 KB | 0644 |
|
| api9f.def | File | 819 B | 0644 |
|
| api9f.sql | File | 1.02 KB | 0644 |
|
| api9fdrop.sql | File | 964 B | 0644 |
|
| apifull.c | File | 13.2 KB | 0644 |
|
| example.def | File | 975 B | 0644 |
|
| winevent.c | File | 12.53 KB | 0644 |
|
| winevent.def | File | 1.15 KB | 0644 |
|
| winevent.rc | File | 965 B | 0644 |
|