概要
コマンドではなくGUIでSQLiteのDBファイルを操作したので、その方法についてまとめた。
A5:SQLツールをダウンロードして使用する。
前提
SQLiteの環境を構築してDBファイルを作成していること。
概要 PythonでSQLite3を使用するにあたり、SQLite3の環境構築を実施したので方法についてまとめた。SQLite3実行ファイルをダウンロードして環境変数のPATHを通すところまで行っている。 […]
概要
SQLite3のデータベースファイルを作成し、テーブル操作を行ったのでその方法についてまとめた。
前提
前提として、SQLite3の環境構築をしていること。[sitecar[…]
A5:SQLツールの導入
A5:SQLツールのダウンロード
Google等で検索してA5:SQLツールのダウンロードサイトを開く。
今回は以下のサイトからダウンローページに遷移した。




A5:SQLツールの起動~DBファイルの選択
ダウンロードフォルダを展開して、フォルダごと任意の場所に移動する。
展開したフォルダ内の以下のファイルを実行する。

実行すると下記のようなダイアログが表示される。




ファイル参照ダイアログが表示されるので、SQLite3のDBファイルを選択する。


選択したらテスト接続ボタンをクリックして問題なくDB接続できるか確認する。

OKボタンをクリックする。



DBに接続
DBに接続するには、DB名をダブルクリックする。

ユーザーIDとパスワードを設定した場合、ここで入力する。
SQLite3は基本的に設定しないのでそのまま接続ボタンをクリックする。

DBとの接続が完了した状態。
コマンドラインから作成したUserテーブルを参照できている。
概要 SQLite3のデータベースファイルを作成し、テーブル操作を行ったのでその方法についてまとめた。 前提 前提として、SQLite3の環境構築をしていること。[sitecar[…]

レコードの挿入
テーブルにレコードを挿入したい場合、テキストボックスに入力してコミットする。
※レコードを更新したいときも同じ手順。

コマンドプロンプトから参照した結果、A5:SQLからレコードの挿入に成功したことがわかる。

コマンドプロンプトを使用する際の注意点
A5:SQLでレコードを挿入後、コマンドプロンプトでテーブルを参照しようとすると以下のエラーが表示されることがある。
「Runtime error: database is locked」
これはSQLite3の仕様のため致し方ない。
コマンドプロンプトから参照したい場合、A5:SQLからDBの接続を切るとエラーは発生しない。
SQL文の入力
SQL文も入力可能。
「ファイル>新規」をクリックする。

SQL文を入力して、Ctr+Enter を押すとSQLが実行される。
