0

I'm trying to get something very simple to work :-)

The driver is mapped in ODBC x64

enter image description here

Imports System.Data.Odbc

Dim odbcconn As New OdbcConnection()

connstr = "Provider=MSDASQL;DSN=Redshift-awsuser;Driver={Amazon Redshift (x64)}; Server=gref-cluster-1.yyy.us-east-1.redshift.amazonaws.com; Database=xxx; UID=yyy; PWD=xxx; Port=1234"

odbcconn.ConnectionString = connstr
odbcconn.Open()

I've run into the following errors:

System.Data.Odbc.OdbcException: 'ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application'

Other connection strings I've tried :

connstr = "Provider=MSDASQL;DSN=Redshift-awsuser;Driver={Amazon Redshift (x86)}; Server=gref-cluster-1.yyy.us-east-1.redshift.amazonaws.com; Database=xxx; UID=yyy; PWD=xxx; Port=1234"

OR

connstr = "DSN=Redshift-awsuser;Driver={Amazon Redshift (x86)}; Server=gref-cluster-1.yyy.us-east-1.redshift.amazonaws.com; Database=xxx; UID=yyy; PWD=xxx; Port=1234"

OR

connstr = "DSN=Redshift-awsuser;Server=gref-cluster-1.yyy.us-east-1.redshift.amazonaws.com; Database=xxx; UID=yyy; PWD=xxx; Port=1234"

I can connect as a Dataset, but not through the ODBCConnection. I need the connection to perform a loop function within VS / Visual Basic.

I haven't used Visual Studio in a while so I'm hoping the solution is super simple!

ShawnOrr
  • 1,249
  • 1
  • 12
  • 24
philipvago
  • 31
  • 3

1 Answers1

0

Screenshot of 32-bit check

I unchecked the part highlighted "Prefer 32-bit" under the Compile settings. To find this go to Project -> (last menu item) [Application name] properties; then compile settings.

ODBC connection - string

I also copied the connection string from the Server Explorer -> Data Connections -> Modify Connection -> Connection String field.

Super confused how this started working.

philipvago
  • 31
  • 3