[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 environment on the WS2008.  I have not cleared licensing for
that, yet.

I'm not a developer savant.  I can code in C#, assemble, and run things.
 I've been googling this issue, but do not really understand what I am
reading.  All of you rank pretty high on my rankings, so I thought I would
ask you all for help.

Thanks for your time and consideration,
dvn

Unhandled Exception: System.TypeInitializationException: The type
initializer for 'CDG.AddAName.AAN' threw an exception. --->
System.BadImageFormatException: Could not load file or assembly
'System.Data.SQLite, Version=1.0.82.0, Culture=neutral,
PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was
made to load a program with an incorrect format.
File name: 'System.Data.SQLite, Version=1.0.82.0, Culture=neutral,
PublicKeyToken=db937bc2d44ff139'
   at CDG.AddAName.AAN..cctor()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].

   --- End of inner exception stack trace ---
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 library is still using the wrong character set,
despite being set to 'Not set' too. I've moved the project to Visual Studio
2010, and it works better now.

The database is now being created fine, but with the same error on the Exec
statement. However, I need to check the data being passed from Fortran to
this library, as I strongly suspect the problem now is down to the
character encoding (I believe the data needs to be changed slightly to have
a null terminator as the last character).


 #include "sqlite3.h"
#include 
#include 
#include 
extern "C"
{
 void EXECUTESQL(char *dataBase, char *query, int returnValue)
 {
  // Create the object
  sqlite3 *oDatabase;
  // Create the error objects
  char *sErrorMessage;
  // Open/create the table, if required
  returnValue = sqlite3_open_v2("C:/Newfolder/testing.db", ,
SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, NULL);
  if (returnValue != SQLITE_OK )
  {
   //sqlite3_close(oDatabase);
   CString t;
   t.Format(_T("%d"), returnValue);
   MessageBoxA(NULL, t, "Error", MB_OK);
   MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open4 Error", MB_OK);
   return;
  }
  // Run the query
  returnValue = sqlite3_exec(oDatabase, query, 0, 0, );
  if (returnValue != SQLITE_OK )
  {
   sqlite3_close(oDatabase);
   MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Exec Error", MB_OK);
   return;
  }
  // Finish up
  sqlite3_close(oDatabase);
  return;
 }
}

Once again, thanks for the help. It was an odd issue. I'll compare the
projects and command line options between the old VS2012 project, and the
VS2010 project created today.

And I'll get checking the data being sent from fortran.


Rob.


On Fri, Apr 5, 2013 at 5:02 PM, Michael Black  wrote:

> 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 
> #include "sqlite3.h"
>
> main()
> {
>   sqlite3 *oDatabase;
>   int returnValue;
>   returnValue = sqlite3_open_v2("D:/SQlite/testing.db", ,
> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, NULL);
>   if (returnValue != SQLITE_OK )
>   {
> printf("%d: %s\n",returnValue,sqlite3_errmsg(oDatabase));
>   }
>   else {
> printf("Got it\n");
>   }
> }
>
> -Original Message-
> From: sqlite-users-boun...@sqlite.org
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie
> Sent: Friday, April 05, 2013 9:47 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] SQL Logic error or missing database
>
> 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 Frankinet
> wrote:
>
> > 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  wrote:
> >
> > > 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  > > >wrote:
> > >
> > > > On Fri, Apr 5, 2013 at 10:08 AM, 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 )
> > > > >  {
> > > > >   //sqlite3_close(oDatabase);
> > > > >   return returnValue ;
> > > > >  }
> > > > >  int anyKey;
> > > > >  return 0;
> > > > >
> > > > > It returns 21. Checking the other project, the open actually does
> > > return
> > > > 21
> > > > > too.
> > > > >
> > > >
> > > >
> > > > Three(3) forward slashes for the Internet path style in Windows,
> maybe?
> > > >
> > > > file:///C:/Newfolder/testing.db
> > > > --
> > > >--
> > > >   --
> > > >  --Ô¿Ô--
> > > > K e V i N
> > > > ___
> > > > sqlite-users mailing list
> > > > sqlite-users@sqlite.org
> > > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > > >
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > 

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  wrote:

> 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",
>> , SQLITE_OPEN_CREATE, NULL);
>>  if (returnValue != SQLITE_OK )
>>  {
>>   //sqlite3_close(oDatabase);
>>   return returnValue ;
>>  }
>>  int anyKey;
>>  return 0;
>> 
>> It returns 21. Checking the other project, the open actually does return 21
>> too.
> 
> This one is returning SQLITE_MISUSE because the SQLITE_OPEN_READWRITE
> flag is not being passed. It seems quite odd that the other code
> would do the same though.
> 
> 
> 
> 
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 
#include "sqlite3.h"

main()
{
  sqlite3 *oDatabase;
  int returnValue;
  returnValue = sqlite3_open_v2("D:/SQlite/testing.db", ,
SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, NULL);
  if (returnValue != SQLITE_OK )
  {
printf("%d: %s\n",returnValue,sqlite3_errmsg(oDatabase));
  }
  else {
printf("Got it\n");
  }
}

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie
Sent: Friday, April 05, 2013 9:47 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] SQL Logic error or missing database

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 Frankinet
wrote:

> 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  wrote:
>
> > 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  > >wrote:
> >
> > > On Fri, Apr 5, 2013 at 10:08 AM, 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 )
> > > >  {
> > > >   //sqlite3_close(oDatabase);
> > > >   return returnValue ;
> > > >  }
> > > >  int anyKey;
> > > >  return 0;
> > > >
> > > > It returns 21. Checking the other project, the open actually does
> > return
> > > 21
> > > > too.
> > > >
> > >
> > >
> > > Three(3) forward slashes for the Internet path style in Windows,
maybe?
> > >
> > > file:///C:/Newfolder/testing.db
> > > --
> > >--
> > >   --
> > >  --Ô¿Ô--
> > > K e V i N
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> Noël Frankinet
> Strategis sprl
> 0478/90.92.54
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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",
, SQLITE_OPEN_CREATE, NULL);
  if (returnValue != SQLITE_OK )
  {
   //sqlite3_close(oDatabase);
   return returnValue ;
  }
  int anyKey;
  return 0;

It returns 21. Checking the other project, the open actually does return 21
too.


This one is returning SQLITE_MISUSE because the SQLITE_OPEN_READWRITE
flag is not being passed. It seems quite odd that the other code
would do the same though.





___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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  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 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 one of sqlite.h
> and sqlite3ext.h, depending whether the code is being built as part of an
> sqlite extension. I'm not sure if including both may have some strange
> effects.
>
> Thanks,
> Kevin
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 one of sqlite.h and 
sqlite3ext.h, depending whether the code is being built as part of an sqlite 
extension. I'm not sure if including both may have some strange effects.

Thanks,
Kevin
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 Frankinet wrote:

> 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  wrote:
>
> > 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  > >wrote:
> >
> > > On Fri, Apr 5, 2013 at 10:08 AM, 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 )
> > > >  {
> > > >   //sqlite3_close(oDatabase);
> > > >   return returnValue ;
> > > >  }
> > > >  int anyKey;
> > > >  return 0;
> > > >
> > > > It returns 21. Checking the other project, the open actually does
> > return
> > > 21
> > > > too.
> > > >
> > >
> > >
> > > Three(3) forward slashes for the Internet path style in Windows, maybe?
> > >
> > > file:///C:/Newfolder/testing.db
> > > --
> > >--
> > >   --
> > >  --Ô¿Ô--
> > > K e V i N
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> Noël Frankinet
> Strategis sprl
> 0478/90.92.54
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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  wrote:

> This works for me under Visual Studio 2010.  I couldn't seem to get a file
> uri to work at all either.
>
> #include 
> #include "sqlite3.h"
>
> main()
> {
>   sqlite3 *oDatabase;
>   int returnValue;
>   returnValue = sqlite3_open_v2("D:/SQlite/testing.db", ,
> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, NULL);
>   if (returnValue != SQLITE_OK )
>   {
> printf("%d: %s\n",returnValue,sqlite3_errmsg(oDatabase));
>   }
>   else {
> printf("Got it\n");
>   }
> }
>
> -Original Message-
> From: sqlite-users-boun...@sqlite.org
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie
> Sent: Friday, April 05, 2013 9:25 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] SQL Logic error or missing database
>
> Same problem, I'm afraid. I've tried just about every combination suggested
> in http://www.sqlite.org/c3ref/open.html
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Noël Frankinet
Strategis sprl
0478/90.92.54
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 
#include "sqlite3.h"

main()
{
  sqlite3 *oDatabase;
  int returnValue;
  returnValue = sqlite3_open_v2("D:/SQlite/testing.db", ,
SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, NULL);
  if (returnValue != SQLITE_OK )
  {
printf("%d: %s\n",returnValue,sqlite3_errmsg(oDatabase));
  }
  else {
printf("Got it\n");
  }
}

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie
Sent: Friday, April 05, 2013 9:25 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] SQL Logic error or missing database

Same problem, I'm afraid. I've tried just about every combination suggested
in http://www.sqlite.org/c3ref/open.html



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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  wrote:

> 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  >wrote:
>
> > On Fri, Apr 5, 2013 at 10:08 AM, 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 )
> > >  {
> > >   //sqlite3_close(oDatabase);
> > >   return returnValue ;
> > >  }
> > >  int anyKey;
> > >  return 0;
> > >
> > > It returns 21. Checking the other project, the open actually does
> return
> > 21
> > > too.
> > >
> >
> >
> > Three(3) forward slashes for the Internet path style in Windows, maybe?
> >
> > file:///C:/Newfolder/testing.db
> > --
> >--
> >   --
> >  --Ô¿Ô--
> > K e V i N
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Noël Frankinet
Strategis sprl
0478/90.92.54
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 wrote:

> On Fri, Apr 5, 2013 at 10:08 AM, 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 )
> >  {
> >   //sqlite3_close(oDatabase);
> >   return returnValue ;
> >  }
> >  int anyKey;
> >  return 0;
> >
> > It returns 21. Checking the other project, the open actually does return
> 21
> > too.
> >
>
>
> Three(3) forward slashes for the Internet path style in Windows, maybe?
>
> file:///C:/Newfolder/testing.db
> --
>--
>   --
>  --Ô¿Ô--
> K e V i N
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 
with "^" then that token must be the first in its field of the document. ** 
Potentially Incompatible Change **



-Ursprüngliche Nachricht-
Von: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
Im Auftrag von Clemens Ladisch
Gesendet: Freitag, 5. April 2013 15:41
An: sqlite-users@sqlite.org
Betreff: Re: [sqlite] FTS Find Tokens at Record Start

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
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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  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 )
>  {
>   //sqlite3_close(oDatabase);
>   return returnValue ;
>  }
>  int anyKey;
>  return 0;
>
> It returns 21. Checking the other project, the open actually does return 21
> too.
>


Three(3) forward slashes for the Internet path style in Windows, maybe?

file:///C:/Newfolder/testing.db
--
   --
  --
 --Ô¿Ô--
K e V i N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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  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",
> , SQLITE_OPEN_CREATE, NULL);
>  if (returnValue != SQLITE_OK )
>  {
>   //sqlite3_close(oDatabase);
>   return returnValue ;
>  }
>  int anyKey;
>  return 0;
>
> It returns 21. Checking the other project, the open actually does return 21
> too.
>
>
> On Fri, Apr 5, 2013 at 3:36 PM, Michael Black  wrote:
>
> > 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 database
> >
> > 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 file is ever created. Is there something dumb
> I'm
> > missing here?
> >
> >
> > extern "C"
> > {
> >
> >  void EXECUTESQL(char *dataBase, char *query, int returnValue)
> >  {
> >
> >   // Checking the incoming data from FORTRAN
> >   CStringW wName(dataBase);
> >   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
> >
> >   // Create the object
> >   sqlite3 *oDatabase;
> >
> >   // Create the error objects
> >   char *sErrorMessage;
> >   // Open/create the table, if required
> >   returnValue = sqlite3_open_v2(dataBase, ,
> > SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
> >   if (returnValue != SQLITE_OK )
> >   {
> >sqlite3_close(oDatabase);
> >MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error",
> MB_OK);
> >return;
> >   }
> >
> >
> > Rob.
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Noël Frankinet
Strategis sprl
0478/90.92.54
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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",
, SQLITE_OPEN_CREATE, NULL);
 if (returnValue != SQLITE_OK )
 {
  //sqlite3_close(oDatabase);
  return returnValue ;
 }
 int anyKey;
 return 0;

It returns 21. Checking the other project, the open actually does return 21
too.


On Fri, Apr 5, 2013 at 3:36 PM, Michael Black  wrote:

> 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 database
>
> 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 file is ever created. Is there something dumb I'm
> missing here?
>
>
> extern "C"
> {
>
>  void EXECUTESQL(char *dataBase, char *query, int returnValue)
>  {
>
>   // Checking the incoming data from FORTRAN
>   CStringW wName(dataBase);
>   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
>
>   // Create the object
>   sqlite3 *oDatabase;
>
>   // Create the error objects
>   char *sErrorMessage;
>   // Open/create the table, if required
>   returnValue = sqlite3_open_v2(dataBase, ,
> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
>   if (returnValue != SQLITE_OK )
>   {
>sqlite3_close(oDatabase);
>MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error", MB_OK);
>return;
>   }
>
>
> Rob.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 use function MATCH in the requested context"

MATCH can be used only with FTS table.  In this query, you are trying
to apply it to the result of the JOIN.

Do the FTS query first (in a subquery), then join the result.

In this particular case, the OR complicates things; you probably want
something like this:

  SELECT * FROM texts WHERE text1 MATCH 'text1-7'
  UNION
  SELECT * FROM texts WHERE docid IN (SELECT recID FROM indexes WHERE metadata1 
> 40)


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 database

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 file is ever created. Is there something dumb I'm
missing here?


extern "C"
{

 void EXECUTESQL(char *dataBase, char *query, int returnValue)
 {

  // Checking the incoming data from FORTRAN
  CStringW wName(dataBase);
  MessageBoxW( NULL, wName, L"Name: ", MB_OK );

  // Create the object
  sqlite3 *oDatabase;

  // Create the error objects
  char *sErrorMessage;
  // Open/create the table, if required
  returnValue = sqlite3_open_v2(dataBase, ,
SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
  if (returnValue != SQLITE_OK )
  {
   sqlite3_close(oDatabase);
   MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error", MB_OK);
   return;
  }


Rob.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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  wrote:

> 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 3:15 PM, Noel Frankinet  >wrote:
>
> > 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  wrote:
> >
> > > 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", ,
> > > SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
> > >
> > > I guess this rules out encoding too?
> > >
> > > Perhaps it's something to do with how the library is being created? I'm
> > > pretty much just including sqlite3.h, sqlite3ext.h, sqlite3.c in a C++
> > > project and compiling it as a static lib.
> > >
> > >
> > > Rob.
> > >
> > >
> > > On Fri, Apr 5, 2013 at 3:03 PM, Richard Hipp  wrote:
> > >
> > > > On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp  wrote:
> > > >
> > > > >
> > > > >
> > > > > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie 
> > > 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 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?
> > > > >>
> > > > >>
> > > > >> extern "C"
> > > > >> {
> > > > >>
> > > > >>  void EXECUTESQL(char *dataBase, char *query, int returnValue)
> > > > >>  {
> > > > >>
> > > > >>   // Checking the incoming data from FORTRAN
> > > > >>   CStringW wName(dataBase);
> > > > >>   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
> > > > >>
> > > > >>   // Create the object
> > > > >>   sqlite3 *oDatabase;
> > > > >>
> > > > >>   // Create the error objects
> > > > >>   char *sErrorMessage;
> > > > >>   // Open/create the table, if required
> > > > >>   returnValue = sqlite3_open_v2(dataBase, ,
> > > > >>
> > > > >
> > > > > I think you want just "oDatabase", without the "&" prefix operator.
> > > > >
> > > >
> > > > No.  Scratch that.  I misread the code.  Ignore what I said.  I'm
> going
> > > to
> > > > get coffee now.
> > > >
> > > >
> > > > >
> > > > >
> > > > >> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
> > > > >>   if (returnValue != SQLITE_OK )
> > > > >>   {
> > > > >>sqlite3_close(oDatabase);
> > > > >>MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open
> Error",
> > > > >> MB_OK);
> > > > >>return;
> > > > >>   }
> > > > >>
> > > > >>
> > > > >> Rob.
> > > > >> ___
> > > > >> sqlite-users mailing list
> > > > >> sqlite-users@sqlite.org
> > > > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > > > >>
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > D. Richard Hipp
> > > > > d...@sqlite.org
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > D. Richard Hipp
> > > > d...@sqlite.org
> > > > ___
> > > > sqlite-users mailing list
> > > > sqlite-users@sqlite.org
> > > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > > >
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> >
> >
> >
> > --
> > Noël Frankinet
> > Strategis sprl
> > 0478/90.92.54
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Noël Frankinet
Strategis sprl
0478/90.92.54
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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, Michael Black  wrote:

> 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: sqlite-users@sqlite.org
> Subject: [sqlite] SQL Logic error or missing database
>
> 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 file is ever created. Is there something dumb I'm
> missing here?
>
>
> extern "C"
> {
>
>  void EXECUTESQL(char *dataBase, char *query, int returnValue)
>  {
>
>   // Checking the incoming data from FORTRAN
>   CStringW wName(dataBase);
>   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
>
>   // Create the object
>   sqlite3 *oDatabase;
>
>   // Create the error objects
>   char *sErrorMessage;
>   // Open/create the table, if required
>   returnValue = sqlite3_open_v2(dataBase, ,
> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
>   if (returnValue != SQLITE_OK )
>   {
>sqlite3_close(oDatabase);
>MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error", MB_OK);
>return;
>   }
>
>
> Rob.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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: sqlite-users@sqlite.org
Subject: [sqlite] SQL Logic error or missing database

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 file is ever created. Is there something dumb I'm
missing here?


extern "C"
{

 void EXECUTESQL(char *dataBase, char *query, int returnValue)
 {

  // Checking the incoming data from FORTRAN
  CStringW wName(dataBase);
  MessageBoxW( NULL, wName, L"Name: ", MB_OK );

  // Create the object
  sqlite3 *oDatabase;

  // Create the error objects
  char *sErrorMessage;
  // Open/create the table, if required
  returnValue = sqlite3_open_v2(dataBase, ,
SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
  if (returnValue != SQLITE_OK )
  {
   sqlite3_close(oDatabase);
   MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error", MB_OK);
   return;
  }


Rob.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 3:15 PM, Noel Frankinet wrote:

> 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  wrote:
>
> > 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", ,
> > SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
> >
> > I guess this rules out encoding too?
> >
> > Perhaps it's something to do with how the library is being created? I'm
> > pretty much just including sqlite3.h, sqlite3ext.h, sqlite3.c in a C++
> > project and compiling it as a static lib.
> >
> >
> > Rob.
> >
> >
> > On Fri, Apr 5, 2013 at 3:03 PM, Richard Hipp  wrote:
> >
> > > On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp  wrote:
> > >
> > > >
> > > >
> > > > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie 
> > 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 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?
> > > >>
> > > >>
> > > >> extern "C"
> > > >> {
> > > >>
> > > >>  void EXECUTESQL(char *dataBase, char *query, int returnValue)
> > > >>  {
> > > >>
> > > >>   // Checking the incoming data from FORTRAN
> > > >>   CStringW wName(dataBase);
> > > >>   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
> > > >>
> > > >>   // Create the object
> > > >>   sqlite3 *oDatabase;
> > > >>
> > > >>   // Create the error objects
> > > >>   char *sErrorMessage;
> > > >>   // Open/create the table, if required
> > > >>   returnValue = sqlite3_open_v2(dataBase, ,
> > > >>
> > > >
> > > > I think you want just "oDatabase", without the "&" prefix operator.
> > > >
> > >
> > > No.  Scratch that.  I misread the code.  Ignore what I said.  I'm going
> > to
> > > get coffee now.
> > >
> > >
> > > >
> > > >
> > > >> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
> > > >>   if (returnValue != SQLITE_OK )
> > > >>   {
> > > >>sqlite3_close(oDatabase);
> > > >>MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error",
> > > >> MB_OK);
> > > >>return;
> > > >>   }
> > > >>
> > > >>
> > > >> Rob.
> > > >> ___
> > > >> sqlite-users mailing list
> > > >> sqlite-users@sqlite.org
> > > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > > >>
> > > >
> > > >
> > > >
> > > > --
> > > > D. Richard Hipp
> > > > d...@sqlite.org
> > >
> > >
> > >
> > >
> > > --
> > > D. Richard Hipp
> > > d...@sqlite.org
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> Noël Frankinet
> Strategis sprl
> 0478/90.92.54
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Simon Slavin

On 5 Apr 2013, at 1:54pm, Rob Collie  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 specifying a full path instead of just a filename.  There's a good change 
that the default directory is not where you think it is.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
SQLITE_OPEN_READWRITE
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 problem ?


On 5 April 2013 15:15, Noel Frankinet  wrote:

> 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  wrote:
>
>> 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", ,
>> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
>>
>> I guess this rules out encoding too?
>>
>> Perhaps it's something to do with how the library is being created? I'm
>> pretty much just including sqlite3.h, sqlite3ext.h, sqlite3.c in a C++
>> project and compiling it as a static lib.
>>
>>
>> Rob.
>>
>>
>> On Fri, Apr 5, 2013 at 3:03 PM, Richard Hipp  wrote:
>>
>> > On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp  wrote:
>> >
>> > >
>> > >
>> > > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie 
>> 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 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?
>> > >>
>> > >>
>> > >> extern "C"
>> > >> {
>> > >>
>> > >>  void EXECUTESQL(char *dataBase, char *query, int returnValue)
>> > >>  {
>> > >>
>> > >>   // Checking the incoming data from FORTRAN
>> > >>   CStringW wName(dataBase);
>> > >>   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
>> > >>
>> > >>   // Create the object
>> > >>   sqlite3 *oDatabase;
>> > >>
>> > >>   // Create the error objects
>> > >>   char *sErrorMessage;
>> > >>   // Open/create the table, if required
>> > >>   returnValue = sqlite3_open_v2(dataBase, ,
>> > >>
>> > >
>> > > I think you want just "oDatabase", without the "&" prefix operator.
>> > >
>> >
>> > No.  Scratch that.  I misread the code.  Ignore what I said.  I'm going
>> to
>> > get coffee now.
>> >
>> >
>> > >
>> > >
>> > >> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
>> > >>   if (returnValue != SQLITE_OK )
>> > >>   {
>> > >>sqlite3_close(oDatabase);
>> > >>MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error",
>> > >> MB_OK);
>> > >>return;
>> > >>   }
>> > >>
>> > >>
>> > >> Rob.
>> > >> ___
>> > >> sqlite-users mailing list
>> > >> sqlite-users@sqlite.org
>> > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> > >>
>> > >
>> > >
>> > >
>> > > --
>> > > D. Richard Hipp
>> > > d...@sqlite.org
>> >
>> >
>> >
>> >
>> > --
>> > D. Richard Hipp
>> > d...@sqlite.org
>> > ___
>> > sqlite-users mailing list
>> > sqlite-users@sqlite.org
>> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> >
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> Noël Frankinet
> Strategis sprl
> 0478/90.92.54
>



-- 
Noël Frankinet
Strategis sprl
0478/90.92.54
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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  wrote:

> 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", ,
> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
>
> I guess this rules out encoding too?
>
> Perhaps it's something to do with how the library is being created? I'm
> pretty much just including sqlite3.h, sqlite3ext.h, sqlite3.c in a C++
> project and compiling it as a static lib.
>
>
> Rob.
>
>
> On Fri, Apr 5, 2013 at 3:03 PM, Richard Hipp  wrote:
>
> > On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp  wrote:
> >
> > >
> > >
> > > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie 
> 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 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?
> > >>
> > >>
> > >> extern "C"
> > >> {
> > >>
> > >>  void EXECUTESQL(char *dataBase, char *query, int returnValue)
> > >>  {
> > >>
> > >>   // Checking the incoming data from FORTRAN
> > >>   CStringW wName(dataBase);
> > >>   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
> > >>
> > >>   // Create the object
> > >>   sqlite3 *oDatabase;
> > >>
> > >>   // Create the error objects
> > >>   char *sErrorMessage;
> > >>   // Open/create the table, if required
> > >>   returnValue = sqlite3_open_v2(dataBase, ,
> > >>
> > >
> > > I think you want just "oDatabase", without the "&" prefix operator.
> > >
> >
> > No.  Scratch that.  I misread the code.  Ignore what I said.  I'm going
> to
> > get coffee now.
> >
> >
> > >
> > >
> > >> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
> > >>   if (returnValue != SQLITE_OK )
> > >>   {
> > >>sqlite3_close(oDatabase);
> > >>MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error",
> > >> MB_OK);
> > >>return;
> > >>   }
> > >>
> > >>
> > >> Rob.
> > >> ___
> > >> sqlite-users mailing list
> > >> sqlite-users@sqlite.org
> > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >>
> > >
> > >
> > >
> > > --
> > > D. Richard Hipp
> > > d...@sqlite.org
> >
> >
> >
> >
> > --
> > D. Richard Hipp
> > d...@sqlite.org
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Noël Frankinet
Strategis sprl
0478/90.92.54
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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", ,
SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");

I guess this rules out encoding too?

Perhaps it's something to do with how the library is being created? I'm
pretty much just including sqlite3.h, sqlite3ext.h, sqlite3.c in a C++
project and compiling it as a static lib.


Rob.


On Fri, Apr 5, 2013 at 3:03 PM, Richard Hipp  wrote:

> On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp  wrote:
>
> >
> >
> > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie  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 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?
> >>
> >>
> >> extern "C"
> >> {
> >>
> >>  void EXECUTESQL(char *dataBase, char *query, int returnValue)
> >>  {
> >>
> >>   // Checking the incoming data from FORTRAN
> >>   CStringW wName(dataBase);
> >>   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
> >>
> >>   // Create the object
> >>   sqlite3 *oDatabase;
> >>
> >>   // Create the error objects
> >>   char *sErrorMessage;
> >>   // Open/create the table, if required
> >>   returnValue = sqlite3_open_v2(dataBase, ,
> >>
> >
> > I think you want just "oDatabase", without the "&" prefix operator.
> >
>
> No.  Scratch that.  I misread the code.  Ignore what I said.  I'm going to
> get coffee now.
>
>
> >
> >
> >> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
> >>   if (returnValue != SQLITE_OK )
> >>   {
> >>sqlite3_close(oDatabase);
> >>MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error",
> >> MB_OK);
> >>return;
> >>   }
> >>
> >>
> >> Rob.
> >> ___
> >> sqlite-users mailing list
> >> sqlite-users@sqlite.org
> >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >>
> >
> >
> >
> > --
> > D. Richard Hipp
> > d...@sqlite.org
>
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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  wrote:

> On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie  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 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?
> >
> >
> > extern "C"
> > {
> >
> >  void EXECUTESQL(char *dataBase, char *query, int returnValue)
> >  {
> >
> >   // Checking the incoming data from FORTRAN
> >   CStringW wName(dataBase);
> >   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
> >
> >   // Create the object
> >   sqlite3 *oDatabase;
> >
> >   // Create the error objects
> >   char *sErrorMessage;
> >   // Open/create the table, if required
> >   returnValue = sqlite3_open_v2(dataBase, ,
> >
>
> I think you want just "oDatabase", without the "&" prefix operator.
>
>
> > SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
> >   if (returnValue != SQLITE_OK )
> >   {
> >sqlite3_close(oDatabase);
> >MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error",
> MB_OK);
> >return;
> >   }
> >
> >
> > Rob.
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Noël Frankinet
Strategis sprl
0478/90.92.54
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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  wrote:

>
>
> On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie  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 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?
>>
>>
>> extern "C"
>> {
>>
>>  void EXECUTESQL(char *dataBase, char *query, int returnValue)
>>  {
>>
>>   // Checking the incoming data from FORTRAN
>>   CStringW wName(dataBase);
>>   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
>>
>>   // Create the object
>>   sqlite3 *oDatabase;
>>
>>   // Create the error objects
>>   char *sErrorMessage;
>>   // Open/create the table, if required
>>   returnValue = sqlite3_open_v2(dataBase, ,
>>
>
> I think you want just "oDatabase", without the "&" prefix operator.
>

No.  Scratch that.  I misread the code.  Ignore what I said.  I'm going to
get coffee now.


>
>
>> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
>>   if (returnValue != SQLITE_OK )
>>   {
>>sqlite3_close(oDatabase);
>>MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error",
>> MB_OK);
>>return;
>>   }
>>
>>
>> Rob.
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org




-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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  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 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?
>
>
> extern "C"
> {
>
>  void EXECUTESQL(char *dataBase, char *query, int returnValue)
>  {
>
>   // Checking the incoming data from FORTRAN
>   CStringW wName(dataBase);
>   MessageBoxW( NULL, wName, L"Name: ", MB_OK );
>
>   // Create the object
>   sqlite3 *oDatabase;
>
>   // Create the error objects
>   char *sErrorMessage;
>   // Open/create the table, if required
>   returnValue = sqlite3_open_v2(dataBase, ,
>

I think you want just "oDatabase", without the "&" prefix operator.


> SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
>   if (returnValue != SQLITE_OK )
>   {
>sqlite3_close(oDatabase);
>MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error", MB_OK);
>return;
>   }
>
>
> Rob.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[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 file is ever created. Is there something dumb I'm
missing here?


extern "C"
{

 void EXECUTESQL(char *dataBase, char *query, int returnValue)
 {

  // Checking the incoming data from FORTRAN
  CStringW wName(dataBase);
  MessageBoxW( NULL, wName, L"Name: ", MB_OK );

  // Create the object
  sqlite3 *oDatabase;

  // Create the error objects
  char *sErrorMessage;
  // Open/create the table, if required
  returnValue = sqlite3_open_v2(dataBase, ,
SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "");
  if (returnValue != SQLITE_OK )
  {
   sqlite3_close(oDatabase);
   MessageBoxA(NULL, sqlite3_errstr(returnValue), "SQL Open Error", MB_OK);
   return;
  }


Rob.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users