Hi John, initdb() does not modify the db handle in main().
Call should be: err_c = initdb(&db); and initdb prototype should be int initdb(sqlite3** db) etc... Rgds, Simon On 11/12/2007, John Williams <[EMAIL PROTECTED]> wrote: > I forgot to attach my sample code to my previous message, and I had > messed up my subscription so I can't figure out how to reply directly > to my thread. > > Anyway here is the zip I meant to attach to my previous message. > >I'm new to using sqlite, so I'm writing a rather simple piece of software > >for a friend that I would normally just use my own file stucture...but being > >that I want to learn about sqlite here I am. I should note that since the > >and program is destined for windows computers I'm doing my development from > >within cygwin to allow me to quickly and easily move to it's native > >environment. So (especially after looking at the backtrace below) it's hard > >for me to be sure if this is a problem with my code, sqlite, or cygwin > >itself. However I should note that if I compile with an option to use > >native win32 libraries instead of the cygwin ones...I still seg fault at the > >same point. > > > >When calling sqlite3_exec from within my add record function I am greeted > >with a seg fault. From viewing a backtrace in gdb I gather the following > >info: > > > >#0 0x77caef22 in ntdll!RtlNumberGenericTableElementsAvl from > >/cygdrive/c/Windows//syswow64/ > >#1 0x00457e10 in cygwin_premain3 > >#2 0x00404724 in sqlite3_mutex_enter > >#3 0x0043c5ee in sqlite3_exec > >#4 0x00401936 in addgen > > > >addgen is obviously my function...and it is separated by multiple calls from > >the actual failure point. My _exec call is pretty straightforward: errc = > >sqlite3_exec(db, sql, NULL, 0, &errmsg). > > > >Since I'm not really sure where the problem is I've attached a zip of my c > >files. AptAssist.c is my main file and contains the full program. > >Temp.cis a simple pull out of the problem function. > > ----------------------------------------------------------------------------- > To unsubscribe, send email to [EMAIL PROTECTED] > ----------------------------------------------------------------------------- > > ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------