From: Michael Calabrese <m2calabr@ournetoffice.com>
To: pgsql-odbc@postgresql.org
Subject: Re: problem after upgrade ---
Date: Tue, 1 Apr 2003 10:37:44 -0800 (PST)
Message-ID: <35298.192.168.1.6.1049222264.squirrel@192.168.0.55> (raw)
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>
> 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 = "ODBC;DSN=BFData;"
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 = 0 Then 'Detect if this is the first time we have run this
function
init = 1 'Mark we have been through here
'Initialize the ODBC Connection
Set wsp = CreateWorkspace("ODBC Workspace", "", "", dbUseODBC)
Set con = wsp.OpenConnection(DB_DNS, , , DB_DNS)
End If
sSQL = "SELECT tablename as Name " & _
"FROM pg_tables " & _
"WHERE schemaname = 'public' " & _
"ORDER BY 1; "
Set rst = con.OpenRecordset(sSQL, dbOpenSnapshot)
'con.Execute sSQL, dbRunAsync
'While con.StillExecuting
' DoEvents
'Wend
On Error Resume Next
Do While Not rst.EOF
stable = 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 = "SELECT viewname as Name " & _
"FROM pg_views " & _
"WHERE schemaname = 'public' " & _
"ORDER BY 1; "
Set rst = con.OpenRecordset(sSQL, dbOpenSnapshot)
'con.Execute sSQL, dbRunAsync
'While con.StillExecuting
' DoEvents
'Wend
On Error Resume Next
Do While Not rst.EOF
stable = 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: m2calabr@ournetoffice.com
Subject: Re: problem after upgrade ---
In-Reply-To: <35298.192.168.1.6.1049222264.squirrel@192.168.0.55>
References: <01a601c2f85e$08c15f20$84faabc8@insyde> <5.2.0.9.0.20030401123422.02b2b958@pop.mindspring.com> <35298.192.168.1.6.1049222264.squirrel@192.168.0.55>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox