0
麻烦使用上vb.net控制台应用程序(64),误差ODBC连接器(64)连接到PostgreSQL数据库, http://www.sumarlidason.com/tmp/120312/odbc_capture1.png数据源名称找不到
Dim ConnectionString = "Driver={PostgreSQL UNICODE};Server=myPGSrv;Port=5432;Database=dbDefault;Uid=postgres;Pwd=pw;"
'Dim ConnectionString = "ODBC;dsn=PostgreSQL35W"
conn = New OdbcConnection(ConnectionString)
'Open connection to an instance of the PostgreSQL database.
Try
conn.Open()
Catch Ex As Exception
MsgBox(Ex.Message)
End Try
Dim commonOdbcCommand = New OdbcCommand
commonOdbcCommand.Connection = conn
conn.Close()
另外,我在控制配置的数据库面板,在这里看到.. http://sumarlidason.com/tmp/120312/odbc_capture.png
你应该告诉我们_why_这就是合作正确的字符串。 –
这是正确的字符串,因为屏幕截图显示数据源名称(DSN)创建为“PostgreSQL35W”。如果OP想要在没有DSN的情况下连接,他需要使用“DRIVER = {PostgreSQL Unicode(x64)}”(注意,他省略了“(x64)”)。 – bohica