Skip site navigation (1) Skip section navigation (2)

RE: Access 2000 ODBC table links

From: "Joseph" <lters(at)mrtc(dot)com>
To: "Pgsql-Odbc" <pgsql-odbc(at)postgresql(dot)org>
Subject: RE: Access 2000 ODBC table links
Date: 2001-08-27 09:35:18
Message-ID: (view raw or whole thread)
Lists: pgsql-odbc
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",

  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

  Set rstLinked = currentdb.OpenRecordset(strTable)

  Debug.Print "Data from linked table:"

  ' Display the first three records of the linked table.
  intTemp = 1
  With rstLinked
    Do While Not .EOF And intTemp <= 3
      Debug.Print , .Fields(0), .Fields(1)
      intTemp = intTemp + 1
    If Not .EOF Then Debug.Print , "[additional records]"
  End With

Exit Function

End Function


-----Original Message-----
From: pgsql-odbc-owner(at)postgresql(dot)org
[mailto:pgsql-odbc-owner(at)postgresql(dot)org]On Behalf Of Markus Wagner
Sent: Monday, August 27, 2001 12:08 AM
To: pgsql-odbc(at)postgresql(dot)org
Subject: [ODBC] Access 2000 ODBC table links


there is a problem using Access 2000 as a frontend for pg data sources.
I make a new system DSN in the control panel and I leave blank the fields
for username and password. Then, I use this DSN to link some tables in an
Access MDB. So whenever I start this MDB and open some table, Access will
ask me for username and password. So far, so good, but: When I login in
this way for the first time, the username I give will be stored
somewhere, and you can never give another one. When I login for the second
time, after closing Access, I can change the username and password, but
will send the username from the first login, with the password of the
login, and Postgres logs something like "password authentication failed for
user x".

So how can we use one frontend for different users?



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

In response to


pgsql-odbc by date

Next:From: Thiago Gozzi PradoDate: 2001-08-27 11:46:31
Subject: CommLog on Win32 ODBC
Previous:From: Markus WagnerDate: 2001-08-27 04:07:41
Subject: Access 2000 ODBC table links

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group