连接前准备:
- C++ 开发环境
- InterSystems ODBC 驱动 (ODBC 驱动会随InterSystems IRIS安装包自动安装在服务器中)
- Connection String
步骤:
- Connection String:其中#include 用来导入需要使用的libraries,"Driver=InterSystems IRIS ODBC35;Host=localhost;Port=1972;Database=USER;UID=SQLAdmin;PWD=deployment-password;\0";是connection string。
#ifdef WIN32 #include <windows.h> #endif #include <sqlext.h> #ifdef UNICODE #include <sqlucode.h> #endif #include <stdio.h> int main() { RETCODE rc; /* Return code for ODBC functions */ HENV henv = NULL; /* Envir