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