Option Explicit
Const sqlstatement = "Select * From dbname"
Private Sub dbconnect()
* *
* *Dim strConnect1 As String
* *strConnect1 = "ODBC;DSN=PostgreSQL;UID=postgres;PWD=password"
* *dbname.Options = dbSQLPassThrough
* *dbname.Connect = strConnect1
* *dbname.RecordsetType = vbRSTypeDynaset
* *dbname.RecordSource = sqlstatement
* *dbname.Refresh
End Sub
this is what i use to connect to postgresql at work. i use vb5 but im sure it will work for vb6. not that much changed from 5 to 6.
you will need to have the postgresql odbc drivers on the system that you are trying to connect from and that should be all you have to do. if you need more help with this jst ask and i will be glad to help
p.s. welcome to the forums
