I'm trying to create an ODBC data source programmatically, and it's not working. I'm using the SQLInstallerError API call, and it's returning zero every time, and not placing any error information in the Stringbuilder string I'm passing it. Has anybody else had this problem?
Dim nErrorCode As Integer
Dim strError As New System.Text.StringBuilder(255)
Dim nErrorLen As Integer
returnCode = SQLConfigDataSource(0&, ODBC_ADD_SYS_DSN, "SQL Server", attributes.ToString)
If returnCode = 0 Then
nErrorCode = SQLInstallerError(1, nErrorCode, strError.ToString, 255, nErrorLen)
End If
Dim nErrorCode As Integer
Dim strError As New System.Text.StringBuilder(255)
Dim nErrorLen As Integer
returnCode = SQLConfigDataSource(0&, ODBC_ADD_SYS_DSN, "SQL Server", attributes.ToString)
If returnCode = 0 Then
nErrorCode = SQLInstallerError(1, nErrorCode, strError.ToString, 255, nErrorLen)
End If