[sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Hello there, For my sins, I'm trying to create a library allowing our legacy fortran code to work with SQL. Calling this from fortran... CALL EXECUTESQL('dbTest'//CHAR(0), cQuery, iReturnValue) ...runs the following code, and yet the error returned is 'SQL Logic error or missing database'. No

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Richard Hipp
On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie rob.col...@gmail.com wrote: Hello there, For my sins, I'm trying to create a library allowing our legacy fortran code to work with SQL. Calling this from fortran... CALL EXECUTESQL('dbTest'//CHAR(0), cQuery, iReturnValue) ...runs the following

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Richard Hipp
On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp d...@sqlite.org wrote: On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie rob.col...@gmail.com wrote: Hello there, For my sins, I'm trying to create a library allowing our legacy fortran code to work with SQL. Calling this from fortran... CALL

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
Is your filename UTF8 ? On 5 April 2013 15:02, Richard Hipp d...@sqlite.org wrote: On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie rob.col...@gmail.com wrote: Hello there, For my sins, I'm trying to create a library allowing our legacy fortran code to work with SQL. Calling this from

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
It's a very odd problem. At first I was worried about character translations between fortran and C, but the following also fails: returnValue = sqlite3_open_v2(testing.db, oDatabase, SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, ); I guess this rules out encoding too? Perhaps it's something to do

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
no it should be ok, check the place where testing.db should be created, do you have write right ? On 5 April 2013 15:12, Rob Collie rob.col...@gmail.com wrote: It's a very odd problem. At first I was worried about character translations between fortran and C, but the following also fails:

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
SQLITE_OPEN_READWRITEhttp://sqlite.org/capi3ref.html#SQLITE_OPEN_AUTOPROXY The database is opened for reading and writing if possible, or reading only if the file is write protected by the operating system. In either case the database must already exist, otherwise an error is returned. Is it your

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Simon Slavin
On 5 Apr 2013, at 1:54pm, Rob Collie rob.col...@gmail.com wrote: CALL EXECUTESQL('dbTest'//CHAR(0), cQuery, iReturnValue) ...runs the following code, and yet the error returned is 'SQL Logic error or missing database'. No file is ever created. Is there something dumb I'm missing here? Try

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Yeap. I've tested on the desktop, running as an admin user. I've tried the full path, with no luck. Should SQLITE_OPEN_READWRITE not be used with SQLITE_OPEN_CREATE? If I remove the SQLITE_OPEN_READWRITE flag, I get 'library routine called out of sequence' instead. Rob. On Fri, Apr 5, 2013 at

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Michael Black
Sqlitge3_close() might be your problem that's masking the real error. You can't close what never got opened. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie Sent: Friday, April 05, 2013 7:54 AM To:

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
I thought that, as soon as I replied. Shifting the message above the now-rem'd close (and changing the error box title to double-check the library is up-to-date) still gets the same error. Very puzzling. As a student programmer, I should probably be taking notes. On Fri, Apr 5, 2013 at 3:28 PM,

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
something odd, check you compilation setup, are you on windows with visual studio ? create a small console sample On 5 April 2013 15:27, Rob Collie rob.col...@gmail.com wrote: Yeap. I've tested on the desktop, running as an admin user. I've tried the full path, with no luck. Should

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Michael Black
Also change the last arg of open to NULL instead of . -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie Sent: Friday, April 05, 2013 7:54 AM To: sqlite-users@sqlite.org Subject: [sqlite] SQL Logic error or missing

Re: [sqlite] FTS Find Tokens at Record Start

2013-04-05 Thread Clemens Ladisch
Paul Vercellotti wrote: using FTS, how do you match records that contain certain tokens beginning at the start of the record Apparently, this information is not stored in the FTS index. Search for the tokens, then manually check with LIKE or something like that. Regards, Clemens

Re: [sqlite] Restrictions on JOINs with FTS tables

2013-04-05 Thread Clemens Ladisch
Paul Vercellotti wrote: SELECT * FROM indexes JOIN texts ON texts.docid == indexes.recID WHERE texts.text1 MATCH text1-7 OR indexes.metadata1 40; Please note that in SQL, the equality comparison operator is =, not ==, and that strings use 'single quotes', not double quotes. Error: unable to

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Yeap, I'm on Visual Studio 2012. I've created a console app: sqlite3 *oDatabase; int returnValue; returnValue = sqlite3_open_v2(file://C:/Newfolder/testing.db, oDatabase, SQLITE_OPEN_CREATE, NULL); if (returnValue != SQLITE_OK ) { //sqlite3_close(oDatabase); return returnValue ; } int

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
I would remove the file:// On 5 April 2013 16:08, Rob Collie rob.col...@gmail.com wrote: Yeap, I'm on Visual Studio 2012. I've created a console app: sqlite3 *oDatabase; int returnValue; returnValue = sqlite3_open_v2(file://C:/Newfolder/testing.db, oDatabase, SQLITE_OPEN_CREATE,

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Kevin Benson
On Fri, Apr 5, 2013 at 10:08 AM, Rob Collie rob.col...@gmail.com wrote: Yeap, I'm on Visual Studio 2012. I've created a console app: sqlite3 *oDatabase; int returnValue; returnValue = sqlite3_open_v2(file://C:/Newfolder/testing.db, oDatabase, SQLITE_OPEN_CREATE, NULL); if

Re: [sqlite] FTS Find Tokens at Record Start

2013-04-05 Thread Fabian Klebert
You might want to check the following: SELECT word FROM fts WHERE fts MATCH '^token' Beginning with 3.7.9 this should only return records that have 'token' at the beginning of the record. See changelog of 3.7.9: If a search token (on the right-hand side of the MATCH operator) in FTS4 begins

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Same problem, I'm afraid. I've tried just about every combination suggested in http://www.sqlite.org/c3ref/open.html On Fri, Apr 5, 2013 at 4:18 PM, Kevin Benson kevin.m.ben...@gmail.comwrote: On Fri, Apr 5, 2013 at 10:08 AM, Rob Collie rob.col...@gmail.com wrote: Yeap, I'm on Visual Studio

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
it's time to check your compiler setting, anything weird ? Are you sure you have the source code of sqlite for windows ? 32 or 64 bits settings ?? On 5 April 2013 16:24, Rob Collie rob.col...@gmail.com wrote: Same problem, I'm afraid. I've tried just about every combination suggested in

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Michael Black
This works for me under Visual Studio 2010. I couldn't seem to get a file uri to work at all either. #include stdio.h #include sqlite3.h main() { sqlite3 *oDatabase; int returnValue; returnValue = sqlite3_open_v2(D:/SQlite/testing.db, oDatabase, SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE,

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
yes that's the setup I use too, so I suspect something more complicated at work (mismatch between h and c file ? check your include path ??) On 5 April 2013 16:29, Michael Black mdblac...@yahoo.com wrote: This works for me under Visual Studio 2010. I couldn't seem to get a file uri to work

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Nothing seems to be overly weird, and the console app is a fresh project, with very little changed. I'm compiling under 32-bit in VS2012 using the amalgamation files. I can attach my test project if needed. I'm really rather curious to know what I broke. On Fri, Apr 5, 2013 at 4:28 PM, Noel

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Kevin Martin
On 5 Apr 2013, at 14:12, Rob Collie wrote: I'm pretty much just including sqlite3.h, sqlite3ext.h, sqlite3.c in a C++ project and compiling it as a static lib. I don't really know anything about Windows, but this looks a bit different to how I do it on Linux. I think you should only include

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
I've tried with just the one .h, it's the same result for both. On Fri, Apr 5, 2013 at 4:52 PM, Kevin Martin ke...@khn.org.uk wrote: On 5 Apr 2013, at 14:12, Rob Collie wrote: I'm pretty much just including sqlite3.h, sqlite3ext.h, sqlite3.c in a C++ project and compiling it as a static

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Dan Kennedy
On 04/05/2013 09:08 PM, Rob Collie wrote: Yeap, I'm on Visual Studio 2012. I've created a console app: sqlite3 *oDatabase; int returnValue; returnValue = sqlite3_open_v2(file://C:/Newfolder/testing.db, oDatabase, SQLITE_OPEN_CREATE, NULL); if (returnValue != SQLITE_OK ) {

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Michael Black
How about just posting your COMPLETE code example for your console app. Some of us can't import a VS2012 project I just sent you a complete example that works. Are you saying this doesn't work for you? #include stdio.h #include sqlite3.h main() { sqlite3 *oDatabase; int returnValue;

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Michael Stephenson
As Dan said, the console app needs the read/write flag. The other app appears to be using CStringW, but the api takes a const char *, not a wide char pointer. I'd try CStringA and explicitly cast to LPCSTR. Michael Stephenson On Apr 5, 2013, at 11:01 AM, Dan Kennedy danielk1...@gmail.com

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Originally, the project was created with _tmain, rather than main. Despite the character set being set to 'Not Set', changing it to main fixed the problem in the console app. It now returns with '0', so thanks! I've not seen _tmain before, and presume it's just a macro. So I wonder whether the

[sqlite] Unhandled Exception: System.TypeInitializationException

2013-04-05 Thread Don V Nielsen
Thanks for reading. I am getting the following error moving a 32 bit application from Windows Server 2003 to WS2008. This is a straight copy from one computer to another. It runs fine on WS2003 and not so good on WS2008. The application was compiled with VS2005. I do not have a development