0

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.

0

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

6 Comments

At the moment, I only have DataSnap and Interbase in the Data Explorer. Is there a way I can add SQLite to that list?
What SKU (Starter, Professional, etc) are you using? IIRC, SQLite wasn't included in XE Starter or Professional, and therefore can't be used via DBExpress (which is what Data Explorer uses). (It's in XE2 and XE3 Pro, but not in Starter, BTW.) There are third-party components that will allow you to use SQLite, but you can't use Data Explorer to work with it. (If you use FireFox, there's an SQLite Manager add-in that works pretty well and is free; it adds a new button to the toolbar that opens an IDE for SQLite.)
I believe I have the Ultimate Edition.
"You believe"? :-) Help->About, and look at the Product Status near the bottom of the dialog. It should say Product Status: Registered, and right below that show the SKU (mine in XE3 clearly says Professional). If you have Ultimate and don't have SQLite, you didn't install something and need to re-run the installer to include the missing pieces.
You should probably open a new question on that, then; it's a totally separate topic from this one. (Make sure you tag it delphi, delphi-xe3, and dbexpress.) You can also open a free support case with Embarcadero for an installation issue. They're actually fairly quick at responding.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.