ホーム › Storage.Jet › JetCreateTableColumnIndex3A
JetCreateTableColumnIndex3A
関数列とインデックスを含むESEテーブルを一括作成する(拡張ANSI版)。
シグネチャ
// ESENT.dll (ANSI / -A)
#include <windows.h>
INT JetCreateTableColumnIndex3A(
JET_SESID sesid,
DWORD dbid,
JET_TABLECREATE3_A* ptablecreate
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| sesid | JET_SESID | in |
| dbid | DWORD | in |
| ptablecreate | JET_TABLECREATE3_A* | inout |
戻り値の型: INT
各言語での呼び出し定義
// ESENT.dll (ANSI / -A)
#include <windows.h>
INT JetCreateTableColumnIndex3A(
JET_SESID sesid,
DWORD dbid,
JET_TABLECREATE3_A* ptablecreate
);[DllImport("ESENT.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int JetCreateTableColumnIndex3A(
UIntPtr sesid, // JET_SESID
uint dbid, // DWORD
IntPtr ptablecreate // JET_TABLECREATE3_A* in/out
);<DllImport("ESENT.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function JetCreateTableColumnIndex3A(
sesid As UIntPtr, ' JET_SESID
dbid As UInteger, ' DWORD
ptablecreate As IntPtr ' JET_TABLECREATE3_A* in/out
) As Integer
End Function' sesid : JET_SESID
' dbid : DWORD
' ptablecreate : JET_TABLECREATE3_A* in/out
Declare PtrSafe Function JetCreateTableColumnIndex3A Lib "esent" ( _
ByVal sesid As LongPtr, _
ByVal dbid As Long, _
ByVal ptablecreate As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
JetCreateTableColumnIndex3A = ctypes.windll.esent.JetCreateTableColumnIndex3A
JetCreateTableColumnIndex3A.restype = ctypes.c_int
JetCreateTableColumnIndex3A.argtypes = [
ctypes.c_size_t, # sesid : JET_SESID
wintypes.DWORD, # dbid : DWORD
ctypes.c_void_p, # ptablecreate : JET_TABLECREATE3_A* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ESENT.dll')
JetCreateTableColumnIndex3A = Fiddle::Function.new(
lib['JetCreateTableColumnIndex3A'],
[
Fiddle::TYPE_UINTPTR_T, # sesid : JET_SESID
-Fiddle::TYPE_INT, # dbid : DWORD
Fiddle::TYPE_VOIDP, # ptablecreate : JET_TABLECREATE3_A* in/out
],
Fiddle::TYPE_INT)#[link(name = "esent")]
extern "system" {
fn JetCreateTableColumnIndex3A(
sesid: usize, // JET_SESID
dbid: u32, // DWORD
ptablecreate: *mut JET_TABLECREATE3_A // JET_TABLECREATE3_A* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ESENT.dll", CharSet = CharSet.Ansi)]
public static extern int JetCreateTableColumnIndex3A(UIntPtr sesid, uint dbid, IntPtr ptablecreate);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetCreateTableColumnIndex3A' -Namespace Win32 -PassThru
# $api::JetCreateTableColumnIndex3A(sesid, dbid, ptablecreate)#uselib "ESENT.dll"
#func global JetCreateTableColumnIndex3A "JetCreateTableColumnIndex3A" sptr, sptr, sptr
; JetCreateTableColumnIndex3A sesid, dbid, varptr(ptablecreate) ; 戻り値は stat
; sesid : JET_SESID -> "sptr"
; dbid : DWORD -> "sptr"
; ptablecreate : JET_TABLECREATE3_A* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "ESENT.dll" #cfunc global JetCreateTableColumnIndex3A "JetCreateTableColumnIndex3A" sptr, int, var ; res = JetCreateTableColumnIndex3A(sesid, dbid, ptablecreate) ; sesid : JET_SESID -> "sptr" ; dbid : DWORD -> "int" ; ptablecreate : JET_TABLECREATE3_A* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "ESENT.dll" #cfunc global JetCreateTableColumnIndex3A "JetCreateTableColumnIndex3A" sptr, int, sptr ; res = JetCreateTableColumnIndex3A(sesid, dbid, varptr(ptablecreate)) ; sesid : JET_SESID -> "sptr" ; dbid : DWORD -> "int" ; ptablecreate : JET_TABLECREATE3_A* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT JetCreateTableColumnIndex3A(JET_SESID sesid, DWORD dbid, JET_TABLECREATE3_A* ptablecreate) #uselib "ESENT.dll" #cfunc global JetCreateTableColumnIndex3A "JetCreateTableColumnIndex3A" intptr, int, var ; res = JetCreateTableColumnIndex3A(sesid, dbid, ptablecreate) ; sesid : JET_SESID -> "intptr" ; dbid : DWORD -> "int" ; ptablecreate : JET_TABLECREATE3_A* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT JetCreateTableColumnIndex3A(JET_SESID sesid, DWORD dbid, JET_TABLECREATE3_A* ptablecreate) #uselib "ESENT.dll" #cfunc global JetCreateTableColumnIndex3A "JetCreateTableColumnIndex3A" intptr, int, intptr ; res = JetCreateTableColumnIndex3A(sesid, dbid, varptr(ptablecreate)) ; sesid : JET_SESID -> "intptr" ; dbid : DWORD -> "int" ; ptablecreate : JET_TABLECREATE3_A* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
esent = windows.NewLazySystemDLL("ESENT.dll")
procJetCreateTableColumnIndex3A = esent.NewProc("JetCreateTableColumnIndex3A")
)
// sesid (JET_SESID), dbid (DWORD), ptablecreate (JET_TABLECREATE3_A* in/out)
r1, _, err := procJetCreateTableColumnIndex3A.Call(
uintptr(sesid),
uintptr(dbid),
uintptr(ptablecreate),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction JetCreateTableColumnIndex3A(
sesid: NativeUInt; // JET_SESID
dbid: DWORD; // DWORD
ptablecreate: Pointer // JET_TABLECREATE3_A* in/out
): Integer; stdcall;
external 'ESENT.dll' name 'JetCreateTableColumnIndex3A';result := DllCall("ESENT\JetCreateTableColumnIndex3A"
, "UPtr", sesid ; JET_SESID
, "UInt", dbid ; DWORD
, "Ptr", ptablecreate ; JET_TABLECREATE3_A* in/out
, "Int") ; return: INT●JetCreateTableColumnIndex3A(sesid, dbid, ptablecreate) = DLL("ESENT.dll", "int JetCreateTableColumnIndex3A(int, dword, void*)")
# 呼び出し: JetCreateTableColumnIndex3A(sesid, dbid, ptablecreate)
# sesid : JET_SESID -> "int"
# dbid : DWORD -> "dword"
# ptablecreate : JET_TABLECREATE3_A* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。