X-Original-To: pgsql-odbc@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A3D69476237 for ; Tue, 1 Apr 2003 13:55:26 -0500 (EST) Received: from mmmain.mm-internal (216-210-237-29.atgi.net [216.210.237.29]) by postgresql.org (Postfix) with ESMTP id 41614476178 for ; Tue, 1 Apr 2003 13:55:25 -0500 (EST) Received: from mmmain.mm-internal (localhost.localdomain [127.0.0.1]) by mmmain.mm-internal (8.12.8/8.12.8) with ESMTP id h31IbjIa016363 for ; Tue, 1 Apr 2003 10:37:45 -0800 Received: (from apache@localhost) by mmmain.mm-internal (8.12.8/8.12.8/Submit) id h31IbiLH016361; Tue, 1 Apr 2003 10:37:44 -0800 X-Authentication-Warning: mmmain.mm-internal: apache set sender to m2calabr@ournetoffice.com using -f Received: from 192.168.1.6 (SquirrelMail authenticated user m2calabr) by 192.168.0.55 with HTTP; Tue, 1 Apr 2003 10:37:44 -0800 (PST) Message-ID: <35298.192.168.1.6.1049222264.squirrel@192.168.0.55> Date: Tue, 1 Apr 2003 10:37:44 -0800 (PST) Subject: Re: problem after upgrade --- From: "Michael Calabrese" To: In-Reply-To: <5.2.0.9.0.20030401123422.02b2b958@pop.mindspring.com> References: <01a601c2f85e$08c15f20$84faabc8@insyde> <5.2.0.9.0.20030401123422.02b2b958@pop.mindspring.com> X-Priority: 3 Importance: Normal Reply-To: m2calabr@ournetoffice.com X-Mailer: SquirrelMail (version 1.2.11) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-25.7 required=5.0 tests=BAYES_10,IN_REP_TO,MSG_ID_ADDED_BY_MTA_3,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,X_AUTH_WARNING autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/12 X-Sequence-Number: 2814 > that when we did the upgrade to PostgreSQL 7.3 recently and now when we > link to the DB/Tables they all come back as public_nnnnnnnnn and > therefore, none of the existing references work. > Here is the Access VBA Code that I use to relink tables from 7.3.x. Please note in the code that I filter out some tables. I hope that this h '**************************************************************************= ******* Private Sub RelinkTables() '**************************************************************************= ******* '----------------------------------------------- 'Make sure all tables and forms are closed!!!!!! '----------------------------------------------- 'DB_DNS As String =3D "ODBC;DSN=3DBFData;" Static wsp As Workspace Static con As Connection Static init As Integer Dim stable As String Dim rst As Recordset Dim sSQL As String If init =3D 0 Then 'Detect if this is the first time we have run this function init =3D 1 'Mark we have been through here 'Initialize the ODBC Connection Set wsp =3D CreateWorkspace("ODBC Workspace", "", "", dbUseODBC) Set con =3D wsp.OpenConnection(DB_DNS, , , DB_DNS) End If sSQL =3D "SELECT tablename as Name " & _ "FROM pg_tables " & _ "WHERE schemaname =3D 'public' " & _ "ORDER BY 1; " Set rst =3D con.OpenRecordset(sSQL, dbOpenSnapshot) 'con.Execute sSQL, dbRunAsync 'While con.StillExecuting ' DoEvents 'Wend On Error Resume Next Do While Not rst.EOF stable =3D rst![Name] rst.MoveNext If (stable <> "mkt_contactdata") And (stable <> "msysconf") And (stable <> "partcost_changes") And (Left(stable, 2) <> "zz") Then On Error Resume Next DoCmd.DeleteObject acTable, stable On Error GoTo 0 DoCmd.TransferDatabase acLink, "ODBC Database", DB_DNS, acTable, stable, stable End If Loop sSQL =3D "SELECT viewname as Name " & _ "FROM pg_views " & _ "WHERE schemaname =3D 'public' " & _ "ORDER BY 1; " Set rst =3D con.OpenRecordset(sSQL, dbOpenSnapshot) 'con.Execute sSQL, dbRunAsync 'While con.StillExecuting ' DoEvents 'Wend On Error Resume Next Do While Not rst.EOF stable =3D rst![Name] rst.MoveNext If (stable <> "mkt_contactdata") And (stable <> "msysconf") And (stable <> "partcost_changes") And (Left(stable, 2) <> "zz") Then On Error Resume Next DoCmd.DeleteObject acTable, stable On Error GoTo 0 DoCmd.TransferDatabase acLink, "ODBC Database", DB_DNS, acTable, stable, stable End If Loop End Sub