Win32 API 日本語リファレンス
ホームSystem.Search › SQLSetScrollOptions

SQLSetScrollOptions

関数
スクロールカーソルの並行性とキーセット動作を設定する(非推奨)。
DLLODBC32.dll呼出規約winapi

シグネチャ

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

SHORT SQLSetScrollOptions(
    void* hstmt,
    WORD fConcurrency,
    INT crowKeyset,
    WORD crowRowset
);

パラメーター

名前方向
hstmtvoid*inout
fConcurrencyWORDin
crowKeysetINTin
crowRowsetWORDin

戻り値の型: SHORT

各言語での呼び出し定義

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

SHORT SQLSetScrollOptions(
    void* hstmt,
    WORD fConcurrency,
    INT crowKeyset,
    WORD crowRowset
);
[DllImport("ODBC32.dll", ExactSpelling = true)]
static extern short SQLSetScrollOptions(
    IntPtr hstmt,   // void* in/out
    ushort fConcurrency,   // WORD
    int crowKeyset,   // INT
    ushort crowRowset   // WORD
);
<DllImport("ODBC32.dll", ExactSpelling:=True)>
Public Shared Function SQLSetScrollOptions(
    hstmt As IntPtr,   ' void* in/out
    fConcurrency As UShort,   ' WORD
    crowKeyset As Integer,   ' INT
    crowRowset As UShort   ' WORD
) As Short
End Function
' hstmt : void* in/out
' fConcurrency : WORD
' crowKeyset : INT
' crowRowset : WORD
Declare PtrSafe Function SQLSetScrollOptions Lib "odbc32" ( _
    ByVal hstmt As LongPtr, _
    ByVal fConcurrency As Integer, _
    ByVal crowKeyset As Long, _
    ByVal crowRowset As Integer) As Integer
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SQLSetScrollOptions = ctypes.windll.odbc32.SQLSetScrollOptions
SQLSetScrollOptions.restype = ctypes.c_short
SQLSetScrollOptions.argtypes = [
    ctypes.POINTER(None),  # hstmt : void* in/out
    ctypes.c_ushort,  # fConcurrency : WORD
    ctypes.c_int,  # crowKeyset : INT
    ctypes.c_ushort,  # crowRowset : WORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ODBC32.dll')
SQLSetScrollOptions = Fiddle::Function.new(
  lib['SQLSetScrollOptions'],
  [
    Fiddle::TYPE_VOIDP,  # hstmt : void* in/out
    -Fiddle::TYPE_SHORT,  # fConcurrency : WORD
    Fiddle::TYPE_INT,  # crowKeyset : INT
    -Fiddle::TYPE_SHORT,  # crowRowset : WORD
  ],
  Fiddle::TYPE_SHORT)
#[link(name = "odbc32")]
extern "system" {
    fn SQLSetScrollOptions(
        hstmt: *mut (),  // void* in/out
        fConcurrency: u16,  // WORD
        crowKeyset: i32,  // INT
        crowRowset: u16  // WORD
    ) -> i16;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ODBC32.dll")]
public static extern short SQLSetScrollOptions(IntPtr hstmt, ushort fConcurrency, int crowKeyset, ushort crowRowset);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ODBC32_SQLSetScrollOptions' -Namespace Win32 -PassThru
# $api::SQLSetScrollOptions(hstmt, fConcurrency, crowKeyset, crowRowset)
#uselib "ODBC32.dll"
#func global SQLSetScrollOptions "SQLSetScrollOptions" sptr, sptr, sptr, sptr
; SQLSetScrollOptions hstmt, fConcurrency, crowKeyset, crowRowset   ; 戻り値は stat
; hstmt : void* in/out -> "sptr"
; fConcurrency : WORD -> "sptr"
; crowKeyset : INT -> "sptr"
; crowRowset : WORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ODBC32.dll"
#cfunc global SQLSetScrollOptions "SQLSetScrollOptions" sptr, int, int, int
; res = SQLSetScrollOptions(hstmt, fConcurrency, crowKeyset, crowRowset)
; hstmt : void* in/out -> "sptr"
; fConcurrency : WORD -> "int"
; crowKeyset : INT -> "int"
; crowRowset : WORD -> "int"
; SHORT SQLSetScrollOptions(void* hstmt, WORD fConcurrency, INT crowKeyset, WORD crowRowset)
#uselib "ODBC32.dll"
#cfunc global SQLSetScrollOptions "SQLSetScrollOptions" intptr, int, int, int
; res = SQLSetScrollOptions(hstmt, fConcurrency, crowKeyset, crowRowset)
; hstmt : void* in/out -> "intptr"
; fConcurrency : WORD -> "int"
; crowKeyset : INT -> "int"
; crowRowset : WORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	odbc32 = windows.NewLazySystemDLL("ODBC32.dll")
	procSQLSetScrollOptions = odbc32.NewProc("SQLSetScrollOptions")
)

// hstmt (void* in/out), fConcurrency (WORD), crowKeyset (INT), crowRowset (WORD)
r1, _, err := procSQLSetScrollOptions.Call(
	uintptr(hstmt),
	uintptr(fConcurrency),
	uintptr(crowKeyset),
	uintptr(crowRowset),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // SHORT
function SQLSetScrollOptions(
  hstmt: Pointer;   // void* in/out
  fConcurrency: Word;   // WORD
  crowKeyset: Integer;   // INT
  crowRowset: Word   // WORD
): Smallint; stdcall;
  external 'ODBC32.dll' name 'SQLSetScrollOptions';
result := DllCall("ODBC32\SQLSetScrollOptions"
    , "Ptr", hstmt   ; void* in/out
    , "UShort", fConcurrency   ; WORD
    , "Int", crowKeyset   ; INT
    , "UShort", crowRowset   ; WORD
    , "Short")   ; return: SHORT
●SQLSetScrollOptions(hstmt, fConcurrency, crowKeyset, crowRowset) = DLL("ODBC32.dll", "int SQLSetScrollOptions(void*, int, int, int)")
# 呼び出し: SQLSetScrollOptions(hstmt, fConcurrency, crowKeyset, crowRowset)
# hstmt : void* in/out -> "void*"
# fConcurrency : WORD -> "int"
# crowKeyset : INT -> "int"
# crowRowset : WORD -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。