RE: Access 2000 ODBC table links

From: Cedar Cox <cedarc(at)visionforisrael(dot)com>
To: Joseph <lters(at)mrtc(dot)com>
Cc: Pgsql-Odbc <pgsql-odbc(at)postgresql(dot)org>
Subject: RE: Access 2000 ODBC table links
Date: 2001-08-27 15:12:20
Message-ID: Pine.LNX.4.21.0108271807170.25543-100000@nanu.visionforisrael.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc


On Mon, 27 Aug 2001, Joseph wrote:

> You could relink the tables on the fly with vb code.
> Then you can specify any user you want.
> You could make your own user login screen etc.
>
> The following works for me in Access 97
> You can make new recordsets using ODBCDirect and when you create the
> workspace you can use any user name you like.
>
> '**********
> Function LinkODBCTable(strTable As String, strSourceTable As String)
>
> If g_Debug Then: On Error GoTo 0: Else: On Error GoTo EH
>
> 'Make new linked table
> 'Sample statemenet -> LinkODBCTable "table_name_to_show_in_access",
> "table_name_in_postgres"
>
> Dim tdfLinked As TableDef
> Dim rstLinked As Recordset
> Dim intTemp As Integer
> Dim ConnectInfo As String
>
> ' Create a new TableDef, set its Connect and
> ' SourceTableName properties based on the passed
> ' arguments, and append it to the TableDefs collection.
> Set tdfLinked = currentdb.CreateTableDef(strTable)
>
> '
> On Error Resume Next
> currentdb.TableDefs.Delete strTable
> If g_Debug Then: On Error GoTo 0: Else: On Error GoTo EH
>
>
> ConnectInfo = "ODBC;DRIVER={PostgreSQL};" _
> & "DATABASE=hsdata;SERVER=clplinux;" _
> & "PORT=5432;" _
> & "UID=" & "YourUserNameHere"
> & ";PWD=;READONLY=0;PROTOCOL=6.4;" _
> & "FAKEOIDINDEX=1;SHOWOIDCOLUMN=1;" _
> & "ROWVERSIONING=1;SHOWSYSTEMTABLES=0;" _
> & "CONNSETTINGS="
>
> tdfLinked.Connect = ConnectInfo
> tdfLinked.SourceTableName = strSourceTable
> currentdb.TableDefs.Append tdfLinked

--------------^^^^^^^^^^^^^^^^
This is part new to me.. appending a table that you just got out of
currentdb. Markus, have you tried this? FYI, I've been talking with
Markus a lot about various things. What he describes seems to be specific
to Access 2000. I can relink tables fine also in ACC97. As he said, 2000
seems to store the username away somewhere in the mdb forever.. even if
you close the mdb and reopen it.

-Cedar

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Kristis Makris 2001-08-27 16:18:16 Re: Error messages not always reported through the ODBCdriver -STATEMENT ERROR missing
Previous Message Thiago Gozzi Prado 2001-08-27 11:46:31 CommLog on Win32 ODBC