| サンプル集 |
|
■VC ■C# ■Java ■BorlandC ■LinuxC ■MS-DOS ■bash ■Excel VBA ■VBScript ■PHP ■HTML ■perl ■iPhone ■Android ■Lua ■other |
| Linuxコマンド |
| 用語集 |
| debian メモ |
| apache2 メモ |
| MySQL メモ |
| Oracle メモ |
| HOME |
SQLServerのレコードを検索し表示します。
◆環境| OS | Windows XP Professional Version 2002 Service Pack 3 |
|---|---|
| VC | Microsoft Visual C++ 2005 77972-235-2482122-41077 |
| DB | SQLServer 2000 - 8.00.760 (Intel X86) |
SQLServerのバージョンを確認します。 バージョンの確認は、osqlで行います。
>osql -Usa
パスワード :
1> select @@version
2> go
----------------------------------------------------------------------
------------------
---------------------------------------------------------------
------------------
Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Desktop Engine on Windows NT 5.1 (Bui
ld 2600: Service Pack 3)
(1 件処理されました)
1>
パスワード :
1> select @@version
2> go
----------------------------------------------------------------------
---------------------------------------------------------------------------------
------------------Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Desktop Engine on Windows NT 5.1 (Bui
ld 2600: Service Pack 3)
(1 件処理されました)
1>
Visual Studioを起動し「Win32 コンソールアプリケーション」を作成します。
プロジェクトのプロパティを開き[全般]の[共通言語ランタイム サポート]を 「共通言語ランタイム サポート、古い構文(/clr:oldSyntax)」を選択します。
プログラムは以下になります。
| SQLSvSelect.cpp | ||
|
文字列以外の値を表示しようとしても何も表示されなかったので、SQL文のCONVERTで文字列に変換しました。
Open OK!!
[1001/2012-11-21 17:33:42/R]
[1002/2012-11-22 14:45:12/L]
[2001/2012-11-22 14:46:01/R]
Close.
[1001/2012-11-21 17:33:42/R]
[1002/2012-11-22 14:45:12/L]
[2001/2012-11-22 14:46:01/R]
Close.
上手くいきました。
Copyright (C) 2012 ymlib.com
