To Attach a second Database is fairly straightforward and shouldn't fail 
unless there is a physical problem with either of the files.

The Attach command example is like this (on a WinX machine):

ATTACH DATABASE 'C:\Documents\OtherDatabase.db' AS "DB2";

Execute that as a standard SQL statement. If that file does not exist, 
it will be created - but the path needs to be valid.
If that statement does not work for you, please let us know what the 
error message is.

Once the statement did work, the second database can be accessed by 
prepending any reference with "DB2", so assuming you have a table in the 
current database called "MyTable" that needs to add rows that doesn't 
exist yet in the same named (with the same schema) table in the attached 
database on a Primary key called "RecID", this SQL might work:

INSERT INTO  DB2.MyTable   SELECT * FROM  MyTable  WHERE MyTable.RecID 
NOT IN (SELECT RecID FROM DB2.MyTable);

More information here:
http://www.sqlite.org/lang_attach.html

On 2015-08-13 07:13 AM, Chris Parsonson wrote:
> Now we get down to the first real problem that of the ATTACH. I have never
> been able to get that to work. If I could have got the ATTACH to work I
> probably would never have had to ask the synchronisation question. Although
> I have never had to do it before in SQLite, I have worked a lot with SQL
> Server doing synchronisation there




Reply via email to