Can't input username into sspi odbcconnection

From: Branden Huggins <branden(dot)huggins(at)rockwellcollins(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Can't input username into sspi odbcconnection
Date: 2016-11-23 22:40:33
Message-ID: CA+Dj3KbZbbm6kXM9q0TevydW3R-WuJ-=qfqkSFnHSy2rBuOfXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Anytime I input any username into the connection string for an Odbc
connectionstring when using SSPI, I get and AccessViolationException.
Is there a way to generate the extra @NETWORK without inputting a username?
or
Can I change something to make the uid string take an input without
throwing an acception?

pg_hba.conf:

host all all 127.0.0.1/32 sspi include_realm=1
host all all ::1/128 sspi include_realm=1

Connection String:

"Driver={PostgreSQL Unicode};Trusted_Connection=yes;uid=bwhuggin(at)CCANET
;database=hostdb-4.2.0;server=localhost;port=5432;"

Simple Code:

try
{
using (OdbcConnection connection = new
OdbcConnection(odbc_connection_string))
{
connection.Open();
}
}
catch (Exception ex)
{
System.Diagnostics.Trace.WriteLine("Connection problem: " + ex);
odbc = false;
}

Result:

Connection problem: System.AccessViolationException: Attempted to read or
write protected memory. This is often an indication that other memory is
corrupt.
at
System.Data.Common.UnsafeNativeMethods.SQLDriverConnectW(OdbcConnectionHandle
hdbc, IntPtr hwnd, String connectionstring, Int16 cbConnectionstring,
IntPtr connectionstringout, Int16 cbConnectionstringoutMax, Int16&
cbConnectionstringout, Int16 fDriverCompletion)
at System.Data.Odbc.OdbcConnectionHandle.Connect(String connectionString)
at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection
connection, OdbcConnectionString constr, OdbcEnvironmentHandle
environmentHandle)
at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection
outerConnection, OdbcConnectionString connectionOptions)
at
System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions
options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo,
DbConnectionPool pool, DbConnection owningObject)
at
System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions
options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo,
DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions
userOptions)
at
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection
owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions
userOptions)
at
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection
owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions
userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&
connection)
at
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection
outerConnection, DbConnectionFactory connectionFactory,
TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at
System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory,
TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at
System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
at System.Data.Odbc.OdbcConnection.Open()
at ConsoleApplication1.Program.TestMethod(String connectionMethod) in
2012\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 86

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Inoue, Hiroshi 2016-11-23 23:14:58 Re: error conection Provider=MSDASQL
Previous Message Mateusz Loskot 2016-11-22 09:21:59 Binding time and timestamp with time zone data type