【问题标题】:ODBC connections in Visual Studio 2022 : Unable to connect to Redshift ClusterVisual Studio 2022 中的 ODBC 连接:无法连接到 Redshift 集群
【发布时间】:2022-02-11 06:46:39
【问题描述】:

我正在尝试做一些非常简单的工作:-)

驱动在 ODBC x64 中映射

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()

我遇到了以下错误:

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

我尝试过的其他连接字符串:

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"

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"

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

我可以以Dataset 的身份进行连接,但不能通过ODBCConnection 进行连接。我需要连接才能在 VS / Visual Basic 中执行循环功能。

我有一段时间没有使用 Visual Studio,所以我希望解决方案超级简单!

【问题讨论】:

标签: visual-studio odbc amazon-redshift driver connection-string


【解决方案1】:

我取消选中编译设置下突出显示“首选 32 位”的部分。要找到它,请转到项目 - >(最后一个菜单项)[应用程序名称]属性;然后编译设置。

我还从服务器资源管理器 -> 数据连接 -> 修改连接 -> 连接字符串字段中复制了连接字符串。

超级困惑这是如何开始工作的。

【讨论】:

    猜你喜欢
    • 2017-11-04
    • 1970-01-01
    • 2013-02-23
    • 2019-12-13
    • 2021-11-23
    • 2020-04-17
    • 2018-07-23
    • 2020-02-08
    • 2020-04-28
    相关资源
    最近更新 更多