[sqlite] Windows Shares again... (SQLITE 2.8)

2005-01-28 Thread Christian Kienle
Hi all,
I have a small windows network here. On every computer I install a 
client which should access a sqlite database (the same one).

The sqlite database is located in on a server and the clients connect 
to this server through a windows share. My app tries to open the 
database which is located on the server. But it doens't work.

I use Qt/C++ for this. Qt provides a SQLITE driver which uses (default) 
the sqlite libs 2.8. And I dont want to change that. I know that SQLITE 
3.x is much better but I have to stick with the current version.

So what to do? I am not able to receive an error message with Qt/C++ - 
well I am able but the last error message is empty.
In general it should be possible to do it via a windows share (I asked 
this in a previous post) but well - here it doesn't work :(

So my question: Are there known problems when doing that? Are there 
workarounds?

I am not "allowed" to install a real database server because of several 
reasons.

Thanks in advanced.

Best Regards, Christian Kienle (QtForum.org)




Re: [sqlite] sqlite and windows shares

2004-12-06 Thread Christian Kienle
Thx.

On Dec 6, 2004, at 5:20 PM, Gregory Letellier wrote:
this works fine on windows, i've use it
Christian Kienle a écrit :
Hi all,
I would like to write an app with C++ which uses sqlite.
We will soon have a windows network here. Is it possible to place the 
sqlite database files on one server and to let the client apps access 
the sqlite db file through a windows share which is "mounted" like a 
normal drive - like G:\my\path\to\mydb.db?

At the moment I have no windows to test it.
It would be cool to tell me that. :)
thx
Christian





[sqlite] sqlite and windows shares

2004-12-06 Thread Christian Kienle
Hi all,
I would like to write an app with C++ which uses sqlite.
We will soon have a windows network here. Is it possible to place the 
sqlite database files on one server and to let the client apps access 
the sqlite db file through a windows share which is "mounted" like a 
normal drive - like G:\my\path\to\mydb.db?

At the moment I have no windows to test it.
It would be cool to tell me that. :)
thx
Christian


Re: [sqlite] Primary Key doenst work

2004-11-21 Thread Christian Kienle
Thanks a lot!
It really helped!


Christian Kienle
http://www.QtForum.org



On Nov 21, 2004, at 6:52 PM, [EMAIL PROTECTED] wrote:
Christian Kienle <[EMAIL PROTECTED]> writes:
I am using SQLite 2.8.5
Firstly, 2.8.5 is ancient.  Numerous bugs have been fixed between 
2.8.5 and
the current version in the 2.8 branch: 2.8.15.  You really should 
upgrade.

and I wanna use a primary key field in one of my tables.
~$ sqlite :memory:
SQLite version 2.8.5
Enter ".help" for instructions
sqlite> create table testing(title text, id AUTOINCREMENT);
sqlite> insert into testing(title) VALUES('this is just a test');
sqlite> select * from testing;
this is just a test|
sqlite>
Although you state that you want to use a primary key field, you're not
specifying anything to be a primary key.  I *think* you're looking for 
'id' to
be your primary key.  A couple of points here:

 - you need to specify that id is a primary key
 - the attribute AUTOINCREMENT is not implemented in 2.8.5.  I think 
that's
   only in the 3.0 tree.  You can get the behavior you probably want, 
though.

CREATE TABLE testing(id INTEGER PRIMARY KEY, title TEXT);
By creating your table this way, with 'id' being an INTEGER PRIMARY 
KEY, 'id'
will always be assigned an integer value one greater than the 
previously
highest value of 'id' in the table (starting at 1), if you either don't
provide an 'id' value, or if you provide it as NULL:

This one doesn't provide 'id' at all:
INSERT INTO testing(title) VALUES ('this is test 1');
This one provides 'id' explicitly as NULL:
INSERT INTO testing(id, title) VALUES (null, 'this test 2');
If you specify a value for 'id', it will take on that value:
INSERT INTO testing(id, title) VALUES (23, 'this is test 23');
A primary key must be unique, so if you try to insert a record with an 
'id'
value that already exists in the table, you'll get an error:

INSERT INTO testing(id, title) VALUES (23, 'this is another test 23');
If you really want to replace the row with an existing 'id' value, use
INSERT OR REPLACE instead of INSERT:
INSERT OR REPLACE INTO testing(id, title)
  VALUES (23, 'this is yet another test 23');
Here's a transcript of the above so you can see what's happening:
sqlite> .mode line
sqlite> CREATE TABLE testing(id INTEGER PRIMARY KEY, title TEXT);
sqlite> .schema
CREATE TABLE testing(id INTEGER PRIMARY KEY, title TEXT);
sqlite> INSERT INTO testing(title) VALUES ('this is test 1');
sqlite> INSERT INTO testing(id, title) VALUES (null, 'this test 2');
sqlite> INSERT INTO testing(id, title) VALUES (23, 'this is test 23');
sqlite> select * from testing;
   id = 1
title = this is test 1
   id = 2
title = this test 2
   id = 23
title = this is test 23
sqlite> INSERT INTO testing(id, title) VALUES (23, 'this is another 
test 23');
SQL error: constraint failed
sqlite> INSERT OR REPLACE INTO testing(id, title)
   ...>   VALUES (23, 'this is yet another test 23');
sqlite> select * from testing;
   id = 1
title = this is test 1

   id = 2
title = this test 2
   id = 23
title = this is yet another test 23
sqlite>



Re: [sqlite] in memory databases

2004-11-21 Thread Christian Kienle
Howdy,
I wrote a C++ wrapper for SQLite.
http://www.qtforum.org/members/christian/flib/doc/ 
classflib_1_1FSqlite.html

And it's downloadable from here:
http://www.qtforum.org/members/christian/flib/hp
And with my wrapper it works like this:
flib::FSqlite sql();
sql.sqliteConnect(":memory:");
sql.setTable("myTable");
sql.select("id > 50");
while(sql.next() {
cout << sql.value("row");
}
----
Christian Kienle
http://www.QtForum.org



On Aug 3, 2004, at 2:49 PM, Rajesh Nagarajan wrote:
Hi
I am trying to move to memory database from file based sqlite db, I  
want my memory database to be
shared across various threads in my process.

How do I do it?
From the Wiki documentation, I found the following
  * (defvar db2 (sql:connect '(":memory:")
 :database-type :sqlite
 :make-default nil
 :if-exists :old))
+ Will this "if-this:old" help me do this?
+ Is it supported in V3.x?
+ I read in the documentation that "Copy" command will no longer be  
supported (V3.0 onwards), then
how do we get to prepare the memory db, any ideas/suggestions for  
doing that?
+ Is it possible to have multiple processes running on the same  
machine with separate memory
database, while the threads inside a process share the same memory  
database?

Can somebody give me a c++ syntax for doing this...or point me to a  
document that explains more on
this?

Thanks & Regards
Rajesh



__
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail



[sqlite] Primary Key doenst work

2004-11-21 Thread Christian Kienle
Hi,
I am using SQLite 2.8.5 and I wanna use a primary key field in one of 
my tables.

~$ sqlite :memory:
SQLite version 2.8.5
Enter ".help" for instructions
sqlite> create table testing(title text, id AUTOINCREMENT);
sqlite> insert into testing(title) VALUES('this is just a test');
sqlite> select * from testing;
this is just a test|
sqlite>
I already read the doc... wondering whats 'wrong' there.
Greets and thanks
--------
Christian Kienle
http://www.QtForum.org





[sqlite] FSqlite - A C++ SQLite wrapper

2004-05-10 Thread Christian Kienle
Hello SQLite fans,

I am on of the people who is working on the flib project. flib includes some 
classes written in c++. One class called FSqlite provides an easy use for the 
SQLite database. Perhaps someone is interested in this class. 

More information can be found here:

- flib hompage: http://www.qtforum.org/members/christian/flib/hp/
- FSqlite documentation (german) :
   http://www.qtforum.org/members/christian/flib/doc/fsqlite 
- FSqlite class documentation:
   http://www.qtforum.org/members/christian/flib/doc/classflib_1_1FSqlite.html
- general flib documentation:
  http://www.qtforum.org/members/christian/flib/doc/

You can download the lates flib classes here: 
http://www.qtforum.org/members/christian/flib/snapshots/

Feedback? Things we could do better -> esspecially in the SQLite 
implementation? 

Greets
Christian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] the second argument of sqlite_open

2004-04-29 Thread Christian Kienle
Hi, 

thanks but we will write our own SQLite class. 
Our class provides something like that:

FSqlite sql;
sql.sqliteConnect("myDatabase");
sql.query("select * from my table");
while(sql.next())
 cout << sql.value("myRow");


I think this is really easy... 
If there will be a new SQLite version we try to change it.
We hope that the API changes not that much...


greets
Christian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] the second argument of sqlite_open

2004-04-28 Thread Christian Kienle
Hi Richard, 

> Version 2 (with the existing API) will continue to be
> supported with bug fixes (as needed) for the foreseeable
> future.  If you want to move to version 3, the API will
> be very similar, but there will be a few differences.
> You will not need to change much code, I don't think,
> to move from version 2 to version 3.

That sounds good. Btw: you have done a really good job with SQLite.

Greets
Christian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] the second argument of sqlite_open

2004-04-27 Thread Christian Kienle
Hi,

at first thank you for the information you gave us.

> There are no plans to ever do anything with the second argument to
> sqlite_open().
Ah okay...

> SQLite version 3 is currently under development.  sqlite3_open() will
> have a flexible mechanism to specify options.  It will not have the
> second parameter currently found on sqlite_open().
Will the API change much? What do you think -> do we need to rewrite much code 
if we use the function with the callback method?

Greets
Christian Kienle


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] the second argument of sqlite_open

2004-04-27 Thread Christian Kienle
Hi all,

at the moment we (a few other gus and I) are developing a cgi library with 
C++. We have choosen SQLite as the first dataase to integrate into our 
library. I quote from the documentation:

"Use the sqlite_open function to open an existing SQLite database or to create 
a new SQLite database. The first argument is the database name. The second 
argument is intended to signal whether the database is going to be used for 
reading and writing or just for reading. But in the current implementation, 
the second argument to sqlite_open is ignored."

Is there a date or a time which is left until this feature (the second 
argument) will be implemented? We don't need this feature but if it will be 
there we need to integrate it - this means for us: changing the source code. 
It would be cool to know when this feature is implemented that we could put 
this on our todo list.

Greets from germany
Christian Kienle

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Trolltech supports SQLite

2004-02-13 Thread Christian Kienle
Hello,

Trolltech - the creators of Qt - a toolkit for developing GUI's with C++ have 
announced a new version of Qt. In the version 3.3 you Qt is able to handle 
SQLite databases ;) 

www.trolltech.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] SQLite Browser (Mac OS 10.3)

2004-01-14 Thread Christian Kienle
> Yes... in OS X, everything that happens is written on in an
> app called Console. I write the author a while back too and he
> asked that I attempt to launch it again with Console running
> and then send him whatever errors/messages appear, but...
> strangely... I am still getting nothing in the Console... as I
> did then.

Then I suggest to send a detailed error description the QtForum 
guys. There are also Trolltech employees around there...

I dont know what to do now. sorry.

Greets

-- 
Linux is like a wigwam - no gates, no windows and an apache 
inside.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] SQLite Browser (Mac OS 10.3)

2004-01-14 Thread Christian Kienle
> None. That's what's strange about it. It won't even launch. It
> starts in the dock but dies one second (literally) later.

I am not really familar with Macstuff.
In Qt there is something like qDebug. QDebug sends Debugmessages 
to stderr. Perhaps you start sqlitebrowser from the commandline 
and give us the output.

The author of the programm is away I think. I wrote him a email 
for ages and got no answer...

Greets

-- 
Linux is like a wigwam - no gates, no windows and an apache 
inside.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] manual? documentation?

2004-01-14 Thread Christian Kienle

> Are there any manuals or further documentation for SQLite than
> what is found on sqlite.org?
>
> I assume that most the database interaction stuff is pretty
> straight forward for individuals with database administration
> experience, but SQLite is my first database. Most of the
> documentation is for advanced and/or special operations. I am
> looking for a tutorial that simply lists the "how-to" of
> adding, manipulating, purging data from a database.
>
> I have successfully created databases with tables and rows and
> am making my way around the command-line access program.
>
>

Hello,

you can use any SQL '92 tutorial.
"SQlite ... Implements most of SQL92."
You only have to lookup this page [1] and compare it with the 
stuff you have learned ;)

greets

[1] http://sqlite.org/omitted.html

-- 
Linux is like a wigwam - no gates, no windows and an apache 
inside.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] SQLite Browser (Mac OS 10.3)

2004-01-14 Thread Christian Kienle
> Has anyone successfully run SQLite Browser...
>
>   http://sqlitebrowser.sourceforge.net
>
>
> ...on Mac OS 10.3?

Hi, 

not but you could ask there:
www.qtforum.org.

SqliteBrowser is written with the Qt toolkit. So the people there 
will help you.

There are also a few guys from the macside.

What error you get?

Greets

-- 
Linux is like a wigwam - no gates, no windows and an apache 
inside.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] looking for help

2004-01-14 Thread Christian Kienle
correct example:
##
F::FSqlite sql;

sql.sqliteConnect( "testdb" );
sql.sqliteQuery( "SELECT * FROM table" );

while( mySqlObject.dataSetIsLeft( ) ) {
  cout << sql.result[ "col_1" ]
  cout << sql.result[ "col_2" ]
}
##

Greets Christian

-- 
Linux is like a wigwam - no gates, no windows and an apache 
inside.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] looking for help

2004-01-14 Thread Christian Kienle
Hello,

perhaps you know: At the moment I am developing a CGI framework 
with C++. Now I have implemented a sqlite class. You can do 
something like this:

##
 F::FSqlite sql;

 sql.sqliteConnect( "testdb" );
 sql.sqliteQuery( "SELECT * FROM table" );

 while( mySqlObject.dataSetIsLeft( ) ) {
  cout << mySqlObject.result[ "col_1" ]
  cout << mySqlObject.result[ "col_2" ]
 }
##

I think this is a very simple database handling. There are also 
many other classes like:

The FFile class for the filehandling.
The FCookie class for the cookiehandling.
The FApplication class for parsing the query string and for some 
string functions.
The FSearch class for searching the own homepage.

If you are interested - especially in featuring the sqlite class 
together with mine let me know.

Greets Christian
-- 
Linux is like a wigwam - no gates, no windows and an apache 
inside.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] cannot declare member function `static int

2004-01-10 Thread Christian Kienle
Hi,

at the moment I try to write a few wrappers for the sqlite api.

Here we are:
##
#include 
#include 
using namespace std;
namespace F {
 class FSqLite : public FApplication {
  public:
   FSqLite() {}
   ~FSqLite() {}

   static int callback(void *NotUsed, int argc, char **argv, char 
**azColName);
   int sqLiteConnect( const char* stringFileName );
   void sqLiteQuery( const char* charSqlQuery );

   private:
string stringDatabaseName;
sqlite *db;
 };
}
##

My Implementation:
##
namespace F {
static int FSqLite :: callback(void *NotUsed, int argc, char 
**argv, char **azColName)
  {
return 0; // only for testing
  }

 int FSqLite :: sqLiteConnect( const char* stringFileName ) {
  //sqlite *db;

  char *zErrMsg = 0;

   db = sqlite_open(stringFileName, 0, &zErrMsg);
   if( db == 0 ) {
// there was an error
return -1;
   }
   else {
stringDatabaseName = stringFileName;
return 0;
   }
 }

 void FSqLite :: sqLiteQuery( const char* charSqlQuery ) {
  int rc;
 // char *zErrMsg = 0;
 char *zErrMsg = 0;
  rc = sqlite_exec(db, charSqlQuery, callback, 0, &zErrMsg );
  //cout << stringDatabaseName;
 }
}
##

I get the following error:

g++ index.cpp -L/usr/local/lib -lsqlite -I/usr/lib/flib -o 
index.cgi
In file included from /usr/lib/flib/fsqlite.h:25,
 from index.cpp:5:
/usr/lib/flib/fsqlite.cpp:3: error: cannot declare member 
function `static int
   F::FSqLite::callback(void*, int, char**, char**)' to have 
static linkage
[EMAIL PROTECTED]:/srv/www/cgi-bin>

I dont know why :(

Hope to find help here...

Greets from germany

Christian
-- 
Linux is like a wigwam - no gates, no windows and an apache 
inside.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] implement a few sqlite functions...

2004-01-06 Thread Christian Kienle
> Whats wrong?

Problem solved:
I have compiled sqlite from source and compiled the example like 
this:

g++ sqltest.cpp -L/usr/local/lib -lsqlite

;)

Greets

-- 
Linux is like a wigwam - no gates, no windows and an apache 
inside.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] implement a few sqlite functions...

2004-01-05 Thread Christian Kienle
Hi guys,

first thank you a lot for the great SQLite database. 

I just want to introduce my work:

At the moment I write a little cgi library with C++. The 
following thins work fine:

- parse GET/POST (Query String)
- (un)set cookies
- file functions
- string functions
- html output optimation
- a little template system
- a search engine class

Now I want to include some SQLite functions. I started with this 
[1] piece of code. I added the following includes:

#include  // for the exit() function which is used by 
the example
#include  // for the basic in/output stuff

I downloaded this [2] and put it into /usr/lib/sqlite
I compiled my programm with this:

$ gcc sqltest.cpp -I/usr/lib/sqlite

and got the following result:

##
linux:/home/christian/Desktop # gcc sqltest.cpp -I/usr/lib/sqlite
/tmp/ccsdAdPd.o(.text+0xda): In function `main':
: undefined reference to `sqlite_open'
/tmp/ccsdAdPd.o(.text+0x127): In function `main':
: undefined reference to `sqlite_exec'
/tmp/ccsdAdPd.o(.text+0x157): In function `main':
: undefined reference to `sqlite_close'
/tmp/ccsdAdPd.o(.eh_frame+0x11): undefined reference to 
`__gxx_personality_v0'
collect2: ld returned 1 exit status
linux:/home/christian/Desktop #
##

Whats wrong?

Thanks - Christian

[1] http://sqlite.org/quickstart.html (the C programm)
[2] http://sqlite.org/sqlite_source.zip

-- 
Linux is like a wigwam - no gates, no windows and an apache 
inside.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]