Nearly there just a couple of outstanding issues any help apreciated
Error:----------------------------------------------
make: Warning: File `logger.cpp' has modification time 45 s in the future
g++ -c -Wall -O -g logger.cpp -o logger.o
logger.cpp: In function `void* start_one_channel(void*)':
logger.cpp:607: warning: format argument is not a pointer (arg 6)
logger.cpp:629: error: jump to case label
logger.cpp:603: error: crosses initialization of `char*zErrMsg'
make: *** [logger.o] Error 1
--------------------------------------------------------
code sample:-------------------------------------------
char *zErrMsg = 0;
char sql[200];
int rc;
sqlite3 *db;
sprintf(sql, "insert into call_data (direction, call_time, dest,
trunk_no, file_name)values('%s','%s','%s','%s','%s')", details.inout,
details.statime,details.cidn,channel,details.filename);
rc = sqlite3_open("/var/tmp/logger/database/logger.db", &db);
rc = sqlite3_exec(db, sql, NULL, 0, &zErrMsg);
if( rc!=SQLITE_OK ){
//fprintf(stderr, "SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
}
sqlite3_close(db);
LOGIT("[%02d] sql string = %s\n",channel,sql);
// Clear out details ready for next call
details.inout[0] = 0;
details.filename[0] = 0;
details.statime[0] = 0;
details.endtime[0] = 0;
details.cidn[0] = 0;
details.cidt[0] = 0;
strcpy(details.term, "");
break;
default: // Any thing else ??
break;
}
break;
-----------------------------------------------------------------
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Sunday, September 10, 2006 1:32 PM
Subject: Re: Re[2]: [sqlite] A lillte help adding sqlite to a c program
On Sun, 10 Sep 2006 13:02:58 +0100, you wrote:
Thanks Teg,
I have been trying to do using a basic example but still
running into problems. Can you expand a little more on your example below.
This is where I am so far.
I am getting a bit closer bit still getting some errors. clearly I am still
getting something wrong with the format of snprintf. any ideas?
Hello Lloydie
If you use a MS Compiler like VC++ 6 or VC++ 7 Net you can look at
my HP. There is a little Example and a Wrapperclass simple to
understand, desgined to handle small Databases.
http://www.thlu.de
Best Regards
Thomas
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------