|
连接DB是用SQLOpen吧?没看到SQLConnect函数
Establishes a connection to an ODBC data source specified in connectStr and returns a connection ID in the return, and the completed connection string in outputStr. If the connection cannot be established, then a negative number ODBC error is returned.
SYNTAX
SQLOpen ( connectStr$ [ , outputStr$] [ , prompt%] )
Syntax
Element Description
connectStr$ A named argument, a required parameter.
outputStr$ Optional.
prompt% Optional. prompt specifies when the driver dialog box is displayed. Valid values:
1
Driver dialog is always displayed.
2
Driver dialog is displayed only when the specification is not sufficient to make the connection.
3
The same as 2, except that dialogs that are not required are grayed and cannot be modified.
4
Driver dialog is not displayed. If the connection is not successful, an error is returned.
COMMENTS
The content of connectStr is described in the Microsoft Programmer's Reference Guide for ODBC. An example string might be "DSN=datasourcename; UID=myid; PWD=mypassword". The return must be a long.
When prompt is omitted, SQLOpen uses 2 as the default. |
|