SQLConnect (odbc32)
Last changed: mbielanczuk-83.15.121.158

.
Summary
TODO - a short description

C# Signature:

[DllImport("odbc32.dll",CharSet=CharSet.Unicode)]
static extern short SQLConnect (int connectionHandle, string serverName,
   short nameLength1, string userName, short nameLength2,
   string authentication, short nameLength3);

VB Signature:

<Runtime.InteropServices.DllImport("odbc32.dll", CharSet:=Runtime.InteropServices.CharSet.Unicode)> _
    Private Function SQLConnect(ByVal hDBc As IntPtr, ByVal servername As String, ByVal serverlen As Short, _
    ByVal username As String, ByVal userlen As Short, ByVal pwd As String, ByVal pwdlen As Short) As Short
    End Function

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

int RetCode;
int hdbc = 0;
int hEnv = 0;
...
if ( SQLAllocEnv(ref hEnv) != SQL_ERROR)
{
     RetCode = SQLAllocConnect(hEnv,ref hdbc);
     RetCode = SQLConnect(hdbc, "Northwind",-3,null,-3,null,-3);
     ...
}
...

Alternative Managed API:

Do you know one? Please contribute it!

Documentation
SQLConnect on MSDN