Win32 API 日本語リファレンス
ホームStorage.Jet › JetRetrieveColumns

JetRetrieveColumns

関数
現在のレコードから複数の列の値をまとめて取得する。
DLLESENT.dll呼出規約winapi

シグネチャ

// ESENT.dll
#include <windows.h>

INT JetRetrieveColumns(
    JET_SESID sesid,
    JET_TABLEID tableid,
    JET_RETRIEVECOLUMN* pretrievecolumn,   // optional
    DWORD cretrievecolumn
);

パラメーター

名前方向
sesidJET_SESIDin
tableidJET_TABLEIDin
pretrievecolumnJET_RETRIEVECOLUMN*inoutoptional
cretrievecolumnDWORDin

戻り値の型: INT

各言語での呼び出し定義

// ESENT.dll
#include <windows.h>

INT JetRetrieveColumns(
    JET_SESID sesid,
    JET_TABLEID tableid,
    JET_RETRIEVECOLUMN* pretrievecolumn,   // optional
    DWORD cretrievecolumn
);
[DllImport("ESENT.dll", ExactSpelling = true)]
static extern int JetRetrieveColumns(
    UIntPtr sesid,   // JET_SESID
    UIntPtr tableid,   // JET_TABLEID
    IntPtr pretrievecolumn,   // JET_RETRIEVECOLUMN* optional, in/out
    uint cretrievecolumn   // DWORD
);
<DllImport("ESENT.dll", ExactSpelling:=True)>
Public Shared Function JetRetrieveColumns(
    sesid As UIntPtr,   ' JET_SESID
    tableid As UIntPtr,   ' JET_TABLEID
    pretrievecolumn As IntPtr,   ' JET_RETRIEVECOLUMN* optional, in/out
    cretrievecolumn As UInteger   ' DWORD
) As Integer
End Function
' sesid : JET_SESID
' tableid : JET_TABLEID
' pretrievecolumn : JET_RETRIEVECOLUMN* optional, in/out
' cretrievecolumn : DWORD
Declare PtrSafe Function JetRetrieveColumns Lib "esent" ( _
    ByVal sesid As LongPtr, _
    ByVal tableid As LongPtr, _
    ByVal pretrievecolumn As LongPtr, _
    ByVal cretrievecolumn As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

JetRetrieveColumns = ctypes.windll.esent.JetRetrieveColumns
JetRetrieveColumns.restype = ctypes.c_int
JetRetrieveColumns.argtypes = [
    ctypes.c_size_t,  # sesid : JET_SESID
    ctypes.c_size_t,  # tableid : JET_TABLEID
    ctypes.c_void_p,  # pretrievecolumn : JET_RETRIEVECOLUMN* optional, in/out
    wintypes.DWORD,  # cretrievecolumn : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ESENT.dll')
JetRetrieveColumns = Fiddle::Function.new(
  lib['JetRetrieveColumns'],
  [
    Fiddle::TYPE_UINTPTR_T,  # sesid : JET_SESID
    Fiddle::TYPE_UINTPTR_T,  # tableid : JET_TABLEID
    Fiddle::TYPE_VOIDP,  # pretrievecolumn : JET_RETRIEVECOLUMN* optional, in/out
    -Fiddle::TYPE_INT,  # cretrievecolumn : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "esent")]
extern "system" {
    fn JetRetrieveColumns(
        sesid: usize,  // JET_SESID
        tableid: usize,  // JET_TABLEID
        pretrievecolumn: *mut JET_RETRIEVECOLUMN,  // JET_RETRIEVECOLUMN* optional, in/out
        cretrievecolumn: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ESENT.dll")]
public static extern int JetRetrieveColumns(UIntPtr sesid, UIntPtr tableid, IntPtr pretrievecolumn, uint cretrievecolumn);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetRetrieveColumns' -Namespace Win32 -PassThru
# $api::JetRetrieveColumns(sesid, tableid, pretrievecolumn, cretrievecolumn)
#uselib "ESENT.dll"
#func global JetRetrieveColumns "JetRetrieveColumns" sptr, sptr, sptr, sptr
; JetRetrieveColumns sesid, tableid, varptr(pretrievecolumn), cretrievecolumn   ; 戻り値は stat
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; pretrievecolumn : JET_RETRIEVECOLUMN* optional, in/out -> "sptr"
; cretrievecolumn : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "ESENT.dll"
#cfunc global JetRetrieveColumns "JetRetrieveColumns" sptr, sptr, var, int
; res = JetRetrieveColumns(sesid, tableid, pretrievecolumn, cretrievecolumn)
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; pretrievecolumn : JET_RETRIEVECOLUMN* optional, in/out -> "var"
; cretrievecolumn : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT JetRetrieveColumns(JET_SESID sesid, JET_TABLEID tableid, JET_RETRIEVECOLUMN* pretrievecolumn, DWORD cretrievecolumn)
#uselib "ESENT.dll"
#cfunc global JetRetrieveColumns "JetRetrieveColumns" intptr, intptr, var, int
; res = JetRetrieveColumns(sesid, tableid, pretrievecolumn, cretrievecolumn)
; sesid : JET_SESID -> "intptr"
; tableid : JET_TABLEID -> "intptr"
; pretrievecolumn : JET_RETRIEVECOLUMN* optional, in/out -> "var"
; cretrievecolumn : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	esent = windows.NewLazySystemDLL("ESENT.dll")
	procJetRetrieveColumns = esent.NewProc("JetRetrieveColumns")
)

// sesid (JET_SESID), tableid (JET_TABLEID), pretrievecolumn (JET_RETRIEVECOLUMN* optional, in/out), cretrievecolumn (DWORD)
r1, _, err := procJetRetrieveColumns.Call(
	uintptr(sesid),
	uintptr(tableid),
	uintptr(pretrievecolumn),
	uintptr(cretrievecolumn),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function JetRetrieveColumns(
  sesid: NativeUInt;   // JET_SESID
  tableid: NativeUInt;   // JET_TABLEID
  pretrievecolumn: Pointer;   // JET_RETRIEVECOLUMN* optional, in/out
  cretrievecolumn: DWORD   // DWORD
): Integer; stdcall;
  external 'ESENT.dll' name 'JetRetrieveColumns';
result := DllCall("ESENT\JetRetrieveColumns"
    , "UPtr", sesid   ; JET_SESID
    , "UPtr", tableid   ; JET_TABLEID
    , "Ptr", pretrievecolumn   ; JET_RETRIEVECOLUMN* optional, in/out
    , "UInt", cretrievecolumn   ; DWORD
    , "Int")   ; return: INT
●JetRetrieveColumns(sesid, tableid, pretrievecolumn, cretrievecolumn) = DLL("ESENT.dll", "int JetRetrieveColumns(int, int, void*, dword)")
# 呼び出し: JetRetrieveColumns(sesid, tableid, pretrievecolumn, cretrievecolumn)
# sesid : JET_SESID -> "int"
# tableid : JET_TABLEID -> "int"
# pretrievecolumn : JET_RETRIEVECOLUMN* optional, in/out -> "void*"
# cretrievecolumn : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。