I'm having difficulty attaching a database from C++.

Within my code, I'm using an sqlite3_prepare call:

prepareResult = pSqlBundle->sqlite3_prepare (db_, "ATTACH DATABASE 'window_5.sdb' AS W5;", -1, &attachSqlStmt, &tailOfSqlStmt);

but it returns an error (i.e., prepareResult comes back as SQLITE_ERROR).

Just to make sure that there were no problems with the databases or my syntax, I tried the attach command (i.e., ATTACH DATABASE 'window_5.sdb' AS W5;) from the command line, and everything worked fine. I tried using the full path name for the database-filename, but that didn't work either.

I'm sure it's something simple, but what I'm I doing wrong?

Thanks,
Greg

Reply via email to