Ok I've moved the test database into the same directory as my C++ test
application (I'm on windows) to remove the directory reference, my
queries now look like:
"ATTACH DATABASE 'Test01.db' AS Test01" - returns SQLITE_OK
"SELECT tbl_name FROM Test01.sqlite_master WHERE type = 'table'"
- returns SQLITE_ERROR
I'm still getting the same error message as before 'no such table
Test01.sqlite_master', I've opened the test database in SQLite Analyzer
and it seems valid. If I take the ' away in the first query I get
SQLITE_ERROR with the message 'No such column: Test01.db' if that helps?
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brown, Daniel
Sent: Thursday, August 14, 2008 4:05 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Loading a existing database 100% into memory
Sorry I should have said, I'm using these calls in C++ on windows.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Thursday, August 14, 2008 1:45 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Loading a existing database 100% into memory
On Thu, 14 Aug 2008, D. Richard Hipp wrote:
> On Aug 14, 2008, at 4:18 PM, Brown, Daniel wrote:
>
>> Hello Stefan,
>>
>> I'm trying to use the code snippet you suggested but when I try to
>> query
>> the master table of the attached database I get and error with the
>> following message:
>> "SQL error: no such table: 'test.sqlite_master';
>>
>> I am running the following queries:
>> 1. "ATTACH DATABASE 'data\\test.db' AS test" - this seems to succeed
>> (no
>> error code).
>> 2. "SELECT tbl_name FROM test.sqlite_master' WHERE type = 'table'" -
>> this one is failing.
>>
>
> Works when I try it.
>
> But I'm not running on windows. Do you really need two backslashes in
> the filename? Should there be just a single backslash? You do not
> quote backslashes in SQL strings as you do in C.
>
> But I'm not running on windows. Do you really need two backslashes in
> the filename? Should there be just a single backslash? You do not
Backslashes are illegal in a Windows filenames, except as folder
delimiters, so "data\\test.db" is not a valid Windows filename. Hence,
if
this is on Windows, the ATTACH must be failing. It must be
'data\test.db'.
Chris
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users