yakbuttercandle
unread,Nov 1, 2009, 8:01:16 PM11/1/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pldatabase
For the life of me, I am not able to get this attach statement to
work: ATTACH DATABASE '/Users/gr/Library/Application\ Support/iPhone\
Simulator/User/Applications/3A5985F2-A114-466E-A169-876B5F72B54A/
Documents/db/ABC.sqlite' as ABC
I suspect the problem may be in the way i'm escaping @" " in the path
to the db I'm trying to attach.
<code>
NSString *escapedPath = [pathToVDb
stringByReplacingOccurrencesOfString:@" " withString:@"\\ "];
attachStmt = [NSString stringWithFormat:@"ATTACH DATABASE '%@' as
%@",escapedPath, vCode];
NSObject<PLResultSet> *results = [dbase
executeQueryAndReturnError:anError statement:attachStmt];
NSString *pragmaStmt = @"pragma database_list";
results = [dbase executeQueryAndReturnError:anError
statement:pragmaStmt];
while ([results next]) {
NSLog(@"DATABASE LIST: \n");
NSLog(@" %@ at %@ \n",[results stringForColumn:@"name"],
[results stringForColumn:@"file"]);
}
</code>
No errors from executeQuery;
Database list only has the main database
The attach statement works (even without escaping spaces in the path)
when I use SQLite Manager Plugin for Firefox (where I issue SQL
statements as opposed to using the Attach Database menu option)
Help!