LoginSignup
0
0

More than 5 years have passed since last update.

VB→Cache'での関数の呼び出しと、あるID番号のインスタンスを開く

Posted at
cachecommand

を用いる。
IDを知らない場合でも、Reader.ReadのあとでIDが分かるので、

OpenId(CacheConnection, string)

で開ける。

        'SQL関数読み出しオブジェクト------------------------------------
        Dim cmd2 As CacheCommand
        cmd2 = User.Main.NewClass1.ByName(cnCache)
        Dim Name_param2 As CacheParameter = New CacheParameter("Field1", CacheDbType.NVarChar) '読みだしたいフィールドの指定
        Name_param2.Value = "" 'ここに検索条件を指定、全検索の場合は""
        cmd2.Parameters.Add(Name_param2) '検索条件をパラメータに追加
        Dim id As String
        Dim d3 As User.Main.NewClass1
        Dim reader2 As CacheDataReader = cmd2.ExecuteReader() '複数データを読み出すインスタンスの生成
        While reader2.Read()
            id = reader2(reader2.GetOrdinal("ID")).ToString()
            d3 = User.Main.NewClass1.OpenId(cnCache, id)
            MsgBox(d3.Field1)
            d3.Close()
        End While

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