ホーム › Storage.Jet › JET_COLUMNBASE_W
JET_COLUMNBASE_W
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbStruct | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| columnid | DWORD | 4 | +4 | +4 | 列の識別子。 |
| coltyp | DWORD | 4 | +8 | +8 | 列のデータ型を示す値。 |
| wCountry | WORD | 2 | +12 | +12 | 国コード(非推奨)。 |
| langid | WORD | 2 | +14 | +14 | テキスト列の言語ID(LANGID)。 |
| cp | WORD | 2 | +16 | +16 | テキスト列のコードページ。 |
| wFiller | WORD | 2 | +18 | +18 | アラインメント用のパディング(未使用)。 |
| cbMax | DWORD | 4 | +20 | +20 | 列に格納可能な最大バイト長。 |
| grbit | DWORD | 4 | +24 | +24 | 列の属性を示すフラグ群。 |
| szBaseTableName | WORD | 512 | +28 | +28 | 基底テーブル名を保持する固定長WCHAR配列(Unicode)。 |
| szBaseColumnName | WORD | 512 | +540 | +540 | 基底列名を保持する固定長WCHAR配列(Unicode)。 |
各言語での定義
#include <windows.h>
// JET_COLUMNBASE_W (x64 1052 / x86 1052 バイト)
typedef struct JET_COLUMNBASE_W {
DWORD cbStruct;
DWORD columnid;
DWORD coltyp;
WORD wCountry;
WORD langid;
WORD cp;
WORD wFiller;
DWORD cbMax;
DWORD grbit;
WORD szBaseTableName[256];
WORD szBaseColumnName[256];
} JET_COLUMNBASE_W;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JET_COLUMNBASE_W
{
public uint cbStruct;
public uint columnid;
public uint coltyp;
public ushort wCountry;
public ushort langid;
public ushort cp;
public ushort wFiller;
public uint cbMax;
public uint grbit;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] public ushort[] szBaseTableName;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] public ushort[] szBaseColumnName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JET_COLUMNBASE_W
Public cbStruct As UInteger
Public columnid As UInteger
Public coltyp As UInteger
Public wCountry As UShort
Public langid As UShort
Public cp As UShort
Public wFiller As UShort
Public cbMax As UInteger
Public grbit As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public szBaseTableName() As UShort
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public szBaseColumnName() As UShort
End Structureimport ctypes
from ctypes import wintypes
class JET_COLUMNBASE_W(ctypes.Structure):
_fields_ = [
("cbStruct", wintypes.DWORD),
("columnid", wintypes.DWORD),
("coltyp", wintypes.DWORD),
("wCountry", ctypes.c_ushort),
("langid", ctypes.c_ushort),
("cp", ctypes.c_ushort),
("wFiller", ctypes.c_ushort),
("cbMax", wintypes.DWORD),
("grbit", wintypes.DWORD),
("szBaseTableName", ctypes.c_ushort * 256),
("szBaseColumnName", ctypes.c_ushort * 256),
]#[repr(C)]
pub struct JET_COLUMNBASE_W {
pub cbStruct: u32,
pub columnid: u32,
pub coltyp: u32,
pub wCountry: u16,
pub langid: u16,
pub cp: u16,
pub wFiller: u16,
pub cbMax: u32,
pub grbit: u32,
pub szBaseTableName: [u16; 256],
pub szBaseColumnName: [u16; 256],
}import "golang.org/x/sys/windows"
type JET_COLUMNBASE_W struct {
cbStruct uint32
columnid uint32
coltyp uint32
wCountry uint16
langid uint16
cp uint16
wFiller uint16
cbMax uint32
grbit uint32
szBaseTableName [256]uint16
szBaseColumnName [256]uint16
}type
JET_COLUMNBASE_W = record
cbStruct: DWORD;
columnid: DWORD;
coltyp: DWORD;
wCountry: Word;
langid: Word;
cp: Word;
wFiller: Word;
cbMax: DWORD;
grbit: DWORD;
szBaseTableName: array[0..255] of Word;
szBaseColumnName: array[0..255] of Word;
end;const JET_COLUMNBASE_W = extern struct {
cbStruct: u32,
columnid: u32,
coltyp: u32,
wCountry: u16,
langid: u16,
cp: u16,
wFiller: u16,
cbMax: u32,
grbit: u32,
szBaseTableName: [256]u16,
szBaseColumnName: [256]u16,
};type
JET_COLUMNBASE_W {.bycopy.} = object
cbStruct: uint32
columnid: uint32
coltyp: uint32
wCountry: uint16
langid: uint16
cp: uint16
wFiller: uint16
cbMax: uint32
grbit: uint32
szBaseTableName: array[256, uint16]
szBaseColumnName: array[256, uint16]struct JET_COLUMNBASE_W
{
uint cbStruct;
uint columnid;
uint coltyp;
ushort wCountry;
ushort langid;
ushort cp;
ushort wFiller;
uint cbMax;
uint grbit;
ushort[256] szBaseTableName;
ushort[256] szBaseColumnName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JET_COLUMNBASE_W サイズ: 1052 バイト(x64)
dim st, 263 ; 4byte整数×263(構造体サイズ 1052 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; columnid : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; coltyp : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; wCountry : WORD (+12, 2byte) wpoke st,12,値 / 値 = wpeek(st,12)
; langid : WORD (+14, 2byte) wpoke st,14,値 / 値 = wpeek(st,14)
; cp : WORD (+16, 2byte) wpoke st,16,値 / 値 = wpeek(st,16)
; wFiller : WORD (+18, 2byte) wpoke st,18,値 / 値 = wpeek(st,18)
; cbMax : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; grbit : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; szBaseTableName : WORD (+28, 512byte) varptr(st)+28 を基点に操作(512byte:入れ子/配列)
; szBaseColumnName : WORD (+540, 512byte) varptr(st)+540 を基点に操作(512byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JET_COLUMNBASE_W
#field int cbStruct
#field int columnid
#field int coltyp
#field short wCountry
#field short langid
#field short cp
#field short wFiller
#field int cbMax
#field int grbit
#field short szBaseTableName 256
#field short szBaseColumnName 256
#endstruct
stdim st, JET_COLUMNBASE_W ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct