View Single Post
Old May 14th, 2004, 2:32 PM   #2
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,646
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
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
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote