Hi,
I have never used ODBC in a VB6 program before.
I am trying to write some simple code to append data from an access 2k table to a postgres table.
My DSN works with access.
I am getting a "type mismatch" error when trying to open the postgres db.
Thanks,
Dan
Private Sub CommandStart_Click()
Dim Pricebooks As Database
Dim Bonneville As Database
Dim WrkSpc As Workspace
Dim Apb As Recordset
Dim Bpb As Recordset
Dim i As Integer
'Open Access table.
Set Pricebooks = OpenDatabase(App.Path & "\Pricebooks.mdb")
Set Apb = Pricebooks.OpenRecordset("pricebook", dbOpenTable)
'Open Postgres table
Set Bonneville = OpenDatabase(Bonneville, False, "ODBC;DSN=PostgresSQL30;UID=postgres;PWD=postgres;")
Set Bpb = Bonneville.OpenRecordset(public_papricebook, dbOpenDynamic)
TextID.Text = Apb("pricebookid") & ""
TextID.Refresh
End Sub