SQL Logic error or missing database

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

SQL Logic error or missing database

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, &oDatabase,
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
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Richard Hipp-3
On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie <[hidden email]> 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, &oDatabase,
>

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
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Richard Hipp-3
On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp <[hidden email]> wrote:

>
>
> On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie <[hidden email]> 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, &oDatabase,
>>
>
> 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
>> [hidden email]
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> D. Richard Hipp
> [hidden email]




--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Noel Frankinet-3
In reply to this post by Richard Hipp-3
Is your filename UTF8 ?


On 5 April 2013 15:02, Richard Hipp <[hidden email]> wrote:

> On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie <[hidden email]> 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, &oDatabase,
> >
>
> 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
> > [hidden email]
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> D. Richard Hipp
> [hidden email]
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
Noël Frankinet
Strategis sprl
0478/90.92.54
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Rob Collie
In reply to this post by Richard Hipp-3
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 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 <[hidden email]> wrote:

> On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp <[hidden email]> wrote:
>
> >
> >
> > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie <[hidden email]> 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, &oDatabase,
> >>
> >
> > 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
> >> [hidden email]
> >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >>
> >
> >
> >
> > --
> > D. Richard Hipp
> > [hidden email]
>
>
>
>
> --
> D. Richard Hipp
> [hidden email]
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Noel Frankinet-3
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 <[hidden email]> 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", &oDatabase,
> 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 <[hidden email]> wrote:
>
> > On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp <[hidden email]> wrote:
> >
> > >
> > >
> > > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie <[hidden email]>
> 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, &oDatabase,
> > >>
> > >
> > > 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
> > >> [hidden email]
> > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >>
> > >
> > >
> > >
> > > --
> > > D. Richard Hipp
> > > [hidden email]
> >
> >
> >
> >
> > --
> > D. Richard Hipp
> > [hidden email]
> > _______________________________________________
> > sqlite-users mailing list
> > [hidden email]
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
Noël Frankinet
Strategis sprl
0478/90.92.54
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Noel Frankinet-3
SQLITE_OPEN_READWRITE<http://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 problem ?


On 5 April 2013 15:15, Noel Frankinet <[hidden email]> 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 <[hidden email]> 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", &oDatabase,
>> 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 <[hidden email]> wrote:
>>
>> > On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp <[hidden email]> wrote:
>> >
>> > >
>> > >
>> > > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie <[hidden email]>
>> 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, &oDatabase,
>> > >>
>> > >
>> > > 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
>> > >> [hidden email]
>> > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> > >>
>> > >
>> > >
>> > >
>> > > --
>> > > D. Richard Hipp
>> > > [hidden email]
>> >
>> >
>> >
>> >
>> > --
>> > D. Richard Hipp
>> > [hidden email]
>> > _______________________________________________
>> > sqlite-users mailing list
>> > [hidden email]
>> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> >
>> _______________________________________________
>> sqlite-users mailing list
>> [hidden email]
>> 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
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Simon Slavin-3
In reply to this post by Rob Collie

On 5 Apr 2013, at 1:54pm, Rob Collie <[hidden email]> 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
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Rob Collie
In reply to this post by Noel Frankinet-3
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 <[hidden email]>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 <[hidden email]> 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", &oDatabase,
> > 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 <[hidden email]> wrote:
> >
> > > On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp <[hidden email]> wrote:
> > >
> > > >
> > > >
> > > > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie <[hidden email]>
> > 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, &oDatabase,
> > > >>
> > > >
> > > > 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
> > > >> [hidden email]
> > > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > > >>
> > > >
> > > >
> > > >
> > > > --
> > > > D. Richard Hipp
> > > > [hidden email]
> > >
> > >
> > >
> > >
> > > --
> > > D. Richard Hipp
> > > [hidden email]
> > > _______________________________________________
> > > sqlite-users mailing list
> > > [hidden email]
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> > _______________________________________________
> > sqlite-users mailing list
> > [hidden email]
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> Noël Frankinet
> Strategis sprl
> 0478/90.92.54
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Michael Black
In reply to this post by Rob Collie
Sqlitge3_close() might be your problem that's masking the real error.
You can't close what never got opened.



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Rob Collie
Sent: Friday, April 05, 2013 7:54 AM
To: [hidden email]
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, &oDatabase,
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
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

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 <[hidden email]> wrote:

> Sqlitge3_close() might be your problem that's masking the real error.
> You can't close what never got opened.
>
>
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Rob Collie
> Sent: Friday, April 05, 2013 7:54 AM
> To: [hidden email]
> 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, &oDatabase,
> 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
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Noel Frankinet-3
In reply to this post by Rob Collie
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 <[hidden email]> 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 <[hidden email]
> >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 <[hidden email]> 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", &oDatabase,
> > > 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 <[hidden email]> wrote:
> > >
> > > > On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp <[hidden email]> wrote:
> > > >
> > > > >
> > > > >
> > > > > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie <[hidden email]>
> > > 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, &oDatabase,
> > > > >>
> > > > >
> > > > > 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
> > > > >> [hidden email]
> > > > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > > > >>
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > D. Richard Hipp
> > > > > [hidden email]
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > D. Richard Hipp
> > > > [hidden email]
> > > > _______________________________________________
> > > > sqlite-users mailing list
> > > > [hidden email]
> > > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > > >
> > > _______________________________________________
> > > sqlite-users mailing list
> > > [hidden email]
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> >
> >
> >
> > --
> > Noël Frankinet
> > Strategis sprl
> > 0478/90.92.54
> > _______________________________________________
> > sqlite-users mailing list
> > [hidden email]
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
Noël Frankinet
Strategis sprl
0478/90.92.54
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Michael Black
In reply to this post by Rob Collie
Also change the last arg of open to NULL instead of "".


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Rob Collie
Sent: Friday, April 05, 2013 7:54 AM
To: [hidden email]
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, &oDatabase,
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
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

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 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 <[hidden email]> wrote:

> Also change the last arg of open to NULL instead of "".
>
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Rob Collie
> Sent: Friday, April 05, 2013 7:54 AM
> To: [hidden email]
> 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, &oDatabase,
> 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
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Noel Frankinet-3
I would remove the "file://"


On 5 April 2013 16:08, Rob Collie <[hidden email]> 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.
>
>
> On Fri, Apr 5, 2013 at 3:36 PM, Michael Black <[hidden email]> wrote:
>
> > Also change the last arg of open to NULL instead of "".
> >
> >
> > -----Original Message-----
> > From: [hidden email]
> > [mailto:[hidden email]] On Behalf Of Rob Collie
> > Sent: Friday, April 05, 2013 7:54 AM
> > To: [hidden email]
> > 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, &oDatabase,
> > 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
> > [hidden email]
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> > _______________________________________________
> > sqlite-users mailing list
> > [hidden email]
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
Noël Frankinet
Strategis sprl
0478/90.92.54
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Ibrahim A
In reply to this post by Rob Collie
On 05.04.2013 14:54, 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, &oDatabase,
> 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
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Can you change the file extension into something different ? "z45" as an
example. Sometimes registered filetypes create issues on windows.


_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Kevin Benson
In reply to this post by Rob Collie
On Fri, Apr 5, 2013 at 10:08 AM, Rob Collie <[hidden email]> 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
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

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 <[hidden email]>wrote:

> On Fri, Apr 5, 2013 at 10:08 AM, Rob Collie <[hidden email]> 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
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Noel Frankinet-3
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 <[hidden email]> 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 <[hidden email]
> >wrote:
>
> > On Fri, Apr 5, 2013 at 10:08 AM, Rob Collie <[hidden email]>
> 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
> > [hidden email]
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
Noël Frankinet
Strategis sprl
0478/90.92.54
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQL Logic error or missing database

Michael Black
In reply to this post by Rob Collie
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, NULL);
  if (returnValue != SQLITE_OK )
  {
    printf("%d: %s\n",returnValue,sqlite3_errmsg(oDatabase));
  }
  else {
    printf("Got it\n");
  }
}

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] 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
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
12