Frage

I watched a video in relations to creating and working with databases in Delphi. The video states that you can create the database using code, the data explorer or the SQLite3 console application, but I am unable to find out how to create the database using the Data Explorer. Does anyone know a way I can go about doing this?

Thank you in advanced.

War es hilfreich?

Lösung

The instructions that follow are for XE3, but they should work for XE as well.

Right-click on the SQLite item in the Data Explorer, and choose New connection.

Enter the full path to your new database file (which, of course, won't exist yet) in the Database edit control.

Click the Advanced button in the lower right corner of the dialog. Find the entry for FailIfMissing, and change the value from True to False, and then click the OK button to close the Advanced Properties dialog.

Click the Test connection button in the lower left corner of the dialog (directly across from the Advanced button you clicked before). You should get a dialog that says Test connection successful. Close the New Connection dialog. (If you don't get a successful test connection at this point, check the path to the database you entered; it will fail if the folder doesn't exist. It can also fail if the SQLite3.dll isn't on your Windows PATH or is the wrong version.)

To create tables, expand the Data Explorer entry for your new connection created above, so you can see the Tables, Views, and Procedures branches. Right-click on Tables, and choose New table from the pop-up menu.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top