📄 146.txt
字号:
直接通过 ODBC API 访问 SQL 数据库
*********************************
ODBC - Open DataBase Connectivity
*********************************
Basic Steps
Connecting to the SQL Server DataBase for retrieving information from tables
*************************************************************
The steps 1 - 3 are for connecting to the SQL Server Database
*************************************************************
1. Allocate ODBC Environment Handle
If SQLAllocEnv(glEnv) <> 0 Then
MsgBox "Unable to initialize ODBC API drivers!"
End
End If
______________________________________________________________
2. Allocate ODBC Database Handle
Dim iStatus As Integer
If SQLAllocConnect(glEnv, glDbc) <> 0 Then
MsgBox "Could not allocate memory for connection Handle!"
ODBCInit = False
' Free the Environment
iStatus = SQLFreeEnv(lEnv)
If iStatus = SQL_ERROR Then
MsgBox "Error Freeing Environment From ODBC Drivers"
End If
' Quit the
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -