wxSQLite3 opening files with space

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

wxSQLite3 opening files with space

Post by evstevemd »

Hi,
It seems that my wxSQLite3Database::Open() does not work for files with Spaces in them.
For example it works fine for data.db but not for "Data Base.db"
Si this a bug? If its normal how can I use wxSQLite3 with filenames spaced?

Thanks!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxSQLite3 opening files with space

Post by utelle »

evstevemd wrote:It seems that my wxSQLite3Database::Open() does not work for files with Spaces in them.
For example it works fine for data.db but not for "Data Base.db"
Si this a bug? If its normal how can I use wxSQLite3 with filenames spaced?
I don't think it's related to wxSQLite3. The filename of the database file is passed to SQLite in UTF-8 encoding but otherwise unchanged. Opening a file with a name which contains spaces should definitely work. I tested it successfully under Windows.

If it doesn't work for you there has to be a different explanation. Does the filename include path information? If yes, make sure the path exists in your file system. What happens when you execute your application? Does your application crash? If yes, can you debug the application to find the location where it crashes? Or do you get an exception? If yes, what is the message text? Or which other phenomenon do you experience?

Regards,

Ulrich
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: wxSQLite3 opening files with space

Post by evstevemd »

utelle wrote:
evstevemd wrote:It seems that my wxSQLite3Database::Open() does not work for files with Spaces in them.
For example it works fine for data.db but not for "Data Base.db"
Si this a bug? If its normal how can I use wxSQLite3 with filenames spaced?
I don't think it's related to wxSQLite3. The filename of the database file is passed to SQLite in UTF-8 encoding but otherwise unchanged. Opening a file with a name which contains spaces should definitely work. I tested it successfully under Windows.
I thought so but I checked with SQlite3 docs they say as you said: it should work!
utelle wrote: If it doesn't work for you there has to be a different explanation. Does the filename include path information? If yes, make sure the path exists in your file system. What happens when you execute your application? Does your application crash? If yes, can you debug the application to find the location where it crashes? Or do you get an exception? If yes, what is the message text? Or which other phenomenon do you experience?

Regards,

Ulrich
App does not crash. As the matter of fact changing name to one without space works fine. There is where I get puzzled. Let me check again if I can discover anything! :oops:
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxSQLite3 opening files with space

Post by utelle »

evstevemd wrote:App does not crash. As the matter of fact changing name to one without space works fine.
This is indeed strange. If wxSQLite3Database::Open fails a wxSQLite3Exception is thrown. Please catch this exception and report the error code and message here. Use code like in the minimal sample

Code: Select all

...
catch (wxSQLite3Exception& e)
{
    cerr << e.GetErrorCode() << ":" << (const char*)(e.GetMessage().mb_str()) << endl;
}
or use wxLogError.
evstevemd wrote:There is where I get puzzled. Let me check again if I can discover anything! :oops:
I'll certainly try to help but without being able to reproduce the problem I have no clue what's going wrong in your application.

Regards,

Ulrich
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: wxSQLite3 opening files with space

Post by evstevemd »

I found a bug in my code. All codes with call to Open have been deleted.
However, I had redirected exceptions and forgot to check it in CodeLite.
Sorry for my stupid mistake and thanks for your hand :oops:
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Post Reply