0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

access2000の作法 その41

Last updated at Posted at 2022-06-11

概要

access2000の作法、調べてみた。
練習問題やってみた。

練習問題

qiita apiを叩いてテーブルに格納せよ。

qiita apiを叩いてテーブルに格納する手順

  • リボンの「作成」→「クエリデザイン」を選択します。
  • 「テーブルの表示」が表示されますが、ここでは追加せずにそのまま閉じます。
  • 画面左上の「SQL 表示」をクリックします。
  • SQL を記述します。
CREATE TABLE qiita(ino AUTOINCREMENT CONSTRAINT PrimaryKey PRIMARY KEY, created_at DATETIME, title TEXT(200), body TEXT, url TEXT(100))"

  • 画面左上の「実行」をクリックします。
  • menuフォームを右クリック。
  • ボタンを設置
  • ウィザードが開く キャンセル
  • プロパティシートを開く
  • イベントを開く
  • クリック時、コードビルダーを開く
Private Sub コマンド62_Click()
    Dim json
    json = http_get("https://qiita.com/api/v2/users/ohisama@github/items?page=1&per_page=5")
    Set jDic = JSON2Dic(json, 1, cDicIdx, 1)
    Dim db As DAO.Database
    Set db = CurrentDb
    For i = 0 To 4
        db.Execute "INSERT INTO qiita(title,created_at,body,url) VALUES('" & jDic(i)("title") & "',#" & Mid(jDic(i)("created_at"), 1, 10) & "#,'" & jDic(i)("body") & "','" & jDic(i)("url") & "');"
    Next
    MsgBox "ok"
End Sub

  • フォームを閉じる
  • 保存する

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?