Ich versuche schon seit mehreren Tagen auf eine lokale Postgres-Datenbank mittels VB-Code zuzugreifen bekomme aber nur Fehlermeldungen.
Vielleicht habt ihr ja Ideen, wie es anders/besser geht oder wie ich die Fehlermeldungen behoben bekomme.
Probiert habe ich folgende Varianten:
Endet in einem Run-time error '-2147467259' [Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified Dim dbOut As ADODB.Connection
Mit ConnectionString Variante 1 - : SQL Server does not exist oder access denied
Bei Variante 2 und 3 : Provider cannot be found. It may not be properly installed
Für Anleitungen/Tipps/Tricks wär ich sehr dankbar.
Vielleicht habt ihr ja Ideen, wie es anders/besser geht oder wie ich die Fehlermeldungen behoben bekomme.
Probiert habe ich folgende Varianten:
Visual Basic-Quellcode
- Dim dbOut As ADODB.Connection
- Dim rsOut As ADODB.Recordset
- Set dbOut = New ADODB.Connection
- Set rsOut = New ADODB.Recordset
- Dim cmd As New ADODB.Command
- dbOut.ConnectionString = "Driver={PostgreSQL};" & _
- "Server=localhost" & _
- "PORT=5432;" & _
- "Database=xxxx;" & _
- "UID=xxxx;"
- dbOut.Open
- Set cmd.ActiveConnection = Conn
- dbOut.Close
Endet in einem Run-time error '-2147467259' [Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified Dim dbOut As ADODB.Connection
Visual Basic-Quellcode
- Dim rsOut As ADODB.Recordset
- Set dbOut = New ADODB.Connection
- Set rsOut = New ADODB.Recordset
- dbOut.ConnectionString = "Provider=SQLOLEDB.1;User ID=xxx;Initial Catalog=xxx;Data Source=localhost"
- 'dbOut.ConnectionString = "Provider=PostgreSQL;User ID=xxx;Initial Catalog=xxx;Persist Security Info=True;Data Source =localhost"
- 'dbOut.ConnectionString = "Provider=PostgreSQL OLE DB Provider;User ID=xxx;Data Source=localhost;Location=xxx"
- 'dbOut.Open
- 'Set cmd.ActiveConnection = dbOut
- 'dbOut.Close
Mit ConnectionString Variante 1 - : SQL Server does not exist oder access denied
Bei Variante 2 und 3 : Provider cannot be found. It may not be properly installed
Für Anleitungen/Tipps/Tricks wär ich sehr dankbar.