Re: [sqlite] Creating a database from inside a program

2007-01-02 Thread Dennis Cote
Rob Richardson wrote: So, I thought I could just issue the following command from inside my program: Sqlite3 newdatabase.db .read schemafile.txt But, when I issue this command from the DOS prompt, it gives me an error message saying that there is no command named "read". Rob, You

Re: [sqlite] Creating a database from inside a program

2006-12-29 Thread Ken
I have a nice solution that really works well, at least from C... 1. Create a template Database. (using whatever method you like, either embedded in your code or via sqlite3). 2. Copy the database to a new file, using plane old cp, copy, or if you like an in code copy using open, read/

Re: [sqlite] Creating a database from inside a program

2006-12-29 Thread Kees Nuyt
On Fri, 29 Dec 2006 12:33:46 -0500, you wrote: > Sqlite3 newdatabase.db .read schemafile.txt > > But, when I issue this command from the DOS prompt, > it gives me an error message saying that there > is no command named "read". Try input redirection: Sqlite3 newdatabase.db

Re: [sqlite] Creating a database from inside a program

2006-12-29 Thread Clay Dowling
Open the database as per normal with sqlite3_open(). Then issue the SQL commands necessary to create your schema. I have a nice little utility I wrote which will take an SQLite schema dump and convert it to an array of C strings that you can issue in sequence (and thanks to Microsoft for the tech

[sqlite] Creating a database from inside a program

2006-12-29 Thread Rob Richardson
Greetings! I need to be able to create a database with a known schema from inside a program. I used sqlite3.exe's .schema command to export the SQL needed to create the schema for my new database. I can create the database by the following steps: C:\: sqlite3 newdatabase.db Sqlite3> .rea