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

ODBC and Access 2000: linked tables problem

From: Moray McConnachie <Moray(dot)McConnachie(at)computing-services(dot)oxford(dot)ac(dot)uk>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: ODBC and Access 2000: linked tables problem
Date: 1999-06-29 10:43:30
Message-ID: EXECMAIL.990629114330.D@moraypc.computing-services.oxford.ac.uk (view raw or flat)
Thread:
Lists: pgsql-interfaces
I was hoping someone could help me out with this, although 
it's probably more of an Access problem than a Postgres 
ODBC one...

I am using Access 2000 and postgres, with the postgres ODBC
drivers.

Everything worked fine under Access 97.

Importing tables from the ODBC connection is fine.
*Linking* is fine as far as the table selection and the importing of
fields and selecting of unique index goes.

However, when I try and open the linked table, it says "Access cannot
open the table in datasheet view". Nor can it access it via a query. I
have also tried hardcoding the table in a way which worked in Access 97
(code appended below), and it fails in exactly the same way.

SQL tracing appears to reveal that when a table is opened, 
Access doesn't even get as far as putting a command to the 
remote database.

This applies to new entirely blank databases. I have uninstalled and
reinstalled Office 2000. I have tried the same thing with the Openlink
ODBC drivers, which also used to work under 97, and now display the same
problem. Nothing has changed on the postgres database. I 
have tried it on a different machine, and again it works 
under Access 97, but not under 2000. I have looked on 
technet/on-line support and posted to 
comp.databases.ms-access.

It's driving me bonkers, particularly since there is 
obviously nothing wrong with the basic link, as it will 
import and link tables, just not open them!

Thanks,
Moray McConnachie

Here's the code I used to link the table...

Public Function CreateTable(Tablename As String) As Boolean

Dim remotetable As String, maintdb As Database, connectstring As String,
tdf As TableDef

remotetable = Tablename
    
    
On Error GoTo error
Set maintdb = CurrentDb

 connectstring =
"ODBC;DSN=PSQLmaint;DATABASE=maint;SERVER=somewhere.me.here.now;PORT=5432;READONLY=0;PROTOCOL=6.4;FAKEOIDINDEX=0;SHOWOIDCOLUMN=0;ROWVERSIONING=0;SHOWSYSTEMTABLES=0;CONNSETTINGS="


Set tdf = maintdb.CreateTableDef(Tablename, dbAttachSavePWD,
remotetable, connectstring)
maintdb.TableDefs.Append tdf
maintdb.TableDefs.Refresh
CreateTable = True
Exit Function

error:
On Error GoTo 0
CreateTable = False
End Function

----------------------
Moray(dot)McConnachie(at)computing-services(dot)oxford(dot)ac(dot)uk


Responses

pgsql-interfaces by date

Next:From: José SoaresDate: 1999-06-29 10:49:23
Subject: Re: [INTERFACES] RE: [ADMIN] float4
Previous:From: Herouth MaozDate: 1999-06-29 08:28:40
Subject: Re: [INTERFACES] RE: [ADMIN] float4

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