X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2587AD1BA45 for ; Sat, 6 Sep 2003 14:54:39 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 86910-02 for ; Sat, 6 Sep 2003 11:54:11 -0300 (ADT) Received: from hall.mail.mindspring.net (hall.mail.mindspring.net [207.69.200.60]) by svr1.postgresql.org (Postfix) with ESMTP id BEDA7D1BA68 for ; Sat, 6 Sep 2003 11:54:03 -0300 (ADT) Received: from h-68-165-133-19.dnvtco56.covad.net ([68.165.133.19] helo=server) by hall.mail.mindspring.net with smtp (Exim 3.33 #1) id 19veS0-0001xq-00 for pgsql-odbc@postgresql.org; Sat, 06 Sep 2003 10:54:08 -0400 Message-ID: <000a01c37487$a661cc60$0100005a@server> From: "DanPerlman" To: Subject: ODBC in VB6 Date: Sat, 6 Sep 2003 09:00:44 -0600 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0007_01C37455.5AE27AA0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.6 tagged_above=0.0 required=5.0 tests=HTML_30_40 X-Spam-Level: X-Archive-Number: 200309/32 X-Sequence-Number: 3230 This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C37455.5AE27AA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 tabl= e 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 =3D OpenDatabase(App.Path & "\Pricebooks.mdb") Set Apb =3D Pricebooks.OpenRecordset("pricebook", dbOpenTable) 'Open Postgres table Set Bonneville =3D OpenDatabase(Bonneville, False, "ODBC;DSN=3DPostgresSQL3= 0;UID=3Dpostgres;PWD=3Dpostgres;") Set Bpb =3D Bonneville.OpenRecordset(public_papricebook, dbOpenDynamic) TextID.Text =3D Apb("pricebookid") & "" TextID.Refresh End Sub ------=_NextPart_000_0007_01C37455.5AE27AA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have never used ODBC in a VB6 progr= am=20 before.
I am trying to write some simple code to a= ppend=20 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=20 open the postgres db.
 
Thanks,
 
Dan
 
Private Sub CommandStart_Click()
 
Dim Pricebooks As Database
Dim Bonnevil= le As=20 Database
Dim WrkSpc As Workspace
Dim Apb As Recordset
Dim Bpb As= =20 Recordset
Dim i As Integer
 
'Open Access table.
Set Pricebooks =3D= =20 OpenDatabase(App.Path & "\Pricebooks.mdb")
Set Apb =3D=20 Pricebooks.OpenRecordset("pricebook", dbOpenTable)
 
'Open Postgres table
Set Bonneville =3D= =20 OpenDatabase(Bonneville, False,=20 "ODBC;DSN=3DPostgresSQL30;UID=3Dpostgres;PWD=3Dpostgres;")
Set Bpb =3D= =20 Bonneville.OpenRecordset(public_papricebook, dbOpenDynamic)
 
TextID.Text =3D Apb("pricebookid") &= =20 ""
TextID.Refresh
 

End Sub
------=_NextPart_000_0007_01C37455.5AE27AA0--