ホーム › Storage.Jet › JetPrepareUpdate
JetPrepareUpdate
関数レコードの挿入や更新のための準備を開始する。
シグネチャ
// ESENT.dll
#include <windows.h>
INT JetPrepareUpdate(
JET_SESID sesid,
JET_TABLEID tableid,
DWORD prep
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| sesid | JET_SESID | in |
| tableid | JET_TABLEID | in |
| prep | DWORD | in |
戻り値の型: INT
各言語での呼び出し定義
// ESENT.dll
#include <windows.h>
INT JetPrepareUpdate(
JET_SESID sesid,
JET_TABLEID tableid,
DWORD prep
);[DllImport("ESENT.dll", ExactSpelling = true)]
static extern int JetPrepareUpdate(
UIntPtr sesid, // JET_SESID
UIntPtr tableid, // JET_TABLEID
uint prep // DWORD
);<DllImport("ESENT.dll", ExactSpelling:=True)>
Public Shared Function JetPrepareUpdate(
sesid As UIntPtr, ' JET_SESID
tableid As UIntPtr, ' JET_TABLEID
prep As UInteger ' DWORD
) As Integer
End Function' sesid : JET_SESID
' tableid : JET_TABLEID
' prep : DWORD
Declare PtrSafe Function JetPrepareUpdate Lib "esent" ( _
ByVal sesid As LongPtr, _
ByVal tableid As LongPtr, _
ByVal prep As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
JetPrepareUpdate = ctypes.windll.esent.JetPrepareUpdate
JetPrepareUpdate.restype = ctypes.c_int
JetPrepareUpdate.argtypes = [
ctypes.c_size_t, # sesid : JET_SESID
ctypes.c_size_t, # tableid : JET_TABLEID
wintypes.DWORD, # prep : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ESENT.dll')
JetPrepareUpdate = Fiddle::Function.new(
lib['JetPrepareUpdate'],
[
Fiddle::TYPE_UINTPTR_T, # sesid : JET_SESID
Fiddle::TYPE_UINTPTR_T, # tableid : JET_TABLEID
-Fiddle::TYPE_INT, # prep : DWORD
],
Fiddle::TYPE_INT)#[link(name = "esent")]
extern "system" {
fn JetPrepareUpdate(
sesid: usize, // JET_SESID
tableid: usize, // JET_TABLEID
prep: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ESENT.dll")]
public static extern int JetPrepareUpdate(UIntPtr sesid, UIntPtr tableid, uint prep);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetPrepareUpdate' -Namespace Win32 -PassThru
# $api::JetPrepareUpdate(sesid, tableid, prep)#uselib "ESENT.dll"
#func global JetPrepareUpdate "JetPrepareUpdate" sptr, sptr, sptr
; JetPrepareUpdate sesid, tableid, prep ; 戻り値は stat
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; prep : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "ESENT.dll"
#cfunc global JetPrepareUpdate "JetPrepareUpdate" sptr, sptr, int
; res = JetPrepareUpdate(sesid, tableid, prep)
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; prep : DWORD -> "int"; INT JetPrepareUpdate(JET_SESID sesid, JET_TABLEID tableid, DWORD prep)
#uselib "ESENT.dll"
#cfunc global JetPrepareUpdate "JetPrepareUpdate" intptr, intptr, int
; res = JetPrepareUpdate(sesid, tableid, prep)
; sesid : JET_SESID -> "intptr"
; tableid : JET_TABLEID -> "intptr"
; prep : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
esent = windows.NewLazySystemDLL("ESENT.dll")
procJetPrepareUpdate = esent.NewProc("JetPrepareUpdate")
)
// sesid (JET_SESID), tableid (JET_TABLEID), prep (DWORD)
r1, _, err := procJetPrepareUpdate.Call(
uintptr(sesid),
uintptr(tableid),
uintptr(prep),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction JetPrepareUpdate(
sesid: NativeUInt; // JET_SESID
tableid: NativeUInt; // JET_TABLEID
prep: DWORD // DWORD
): Integer; stdcall;
external 'ESENT.dll' name 'JetPrepareUpdate';result := DllCall("ESENT\JetPrepareUpdate"
, "UPtr", sesid ; JET_SESID
, "UPtr", tableid ; JET_TABLEID
, "UInt", prep ; DWORD
, "Int") ; return: INT●JetPrepareUpdate(sesid, tableid, prep) = DLL("ESENT.dll", "int JetPrepareUpdate(int, int, dword)")
# 呼び出し: JetPrepareUpdate(sesid, tableid, prep)
# sesid : JET_SESID -> "int"
# tableid : JET_TABLEID -> "int"
# prep : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。