Hi Thomas,
        You are right, Access use ODBC. With Access 97 and 2000 (I never touch XP)
you need to link the remote table to a kind of intermediate representation
in Access. To link a table you follow these steps:

1. Open an access mdb file or create a new one
2. File -> Get External Date -> Link tables
3. Choose "ODBC Database" in the "Files of type" drop down
4. Choose the DSN of your Sapdb database
5. The sapdb ODBC driver will then prompt for login
6. Choose the table from the ones in your sapdb database

When you follow these steps, Access is normally able to figure out what is
the primary key and it creates a corresponding fictious unique index. It
does the same for all the other indexes. I think Jet use this to optimise
its queries. With version 7.3.0.24, you will have an additional step which
will prompt you to identify the fields that are part of the primary key but
all the other indexes will create correctly. Like I said in my previous
message, we manage single-logon by reconnecting the tables in the code with
something like:

Dim strConnect as String
Dim Conn as Connection
Dim Db as Database
Dim tdf as TableDef

Set Db = CurrentDb
strConnect = "ODBC;DSN=LOGILOC;UID=" & UserName & ";PWD=" & PassWord &
";SERVERDB=LOGILOC;SERVERNODE=" & Server
Set Conn = Ws.OpenConnection("", dbDriverNoPrompt, , strConnect)
For Each tdf In Db.TableDefs
   If Len(tdf.Connect) > 0 Then
        If Left(tdf.Connect, Len(strConnect)) <> strConnect Then
            tdf.Connect = strConnect
            tdf.RefreshLink
        End If
    End If
Next

The variables UserName and PassWord are string and they are initialised at
logon. They are defined as user in Sapdb.  Server is the name of the current
server (we use it to switch from development to production).

Additionnal info:

Server OS: Linux RedHat 6.2
Win32 ODBC: Tried 7.2 and 7.3.0.18, same result

I tried to be clear but english is not my first language so do not hesitate
to ask more questions.

Thank you,

Yves

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Koetter,
Thomas Theodor
Sent: 11 juin, 2002 03:01
To: 'Yves Trudeau'; SAP DB General List
Subject: RE: MS Access and primary key


Hi Yves

> -----Original Message-----
> From: Yves Trudeau [mailto:[EMAIL PROTECTED]]
[snip]
> "linked" tables with the correct user rights. With version
> 7.3.0.20, the
> refreshlink import correctly the primary keys of the tables but with
> 7.3.0.24, no primary keys are imported. This causes the MS
> Access forms to
> be read-only.


I guess, the connection is done by ODBC. Can you please provide me
with a small example in order to reproduce the problem.

Please describe all necessary steps in detail since I seldom use Access.


Regards  Thomas


----------------------------------------------
Dr. Thomas K�tter
SAP DB, SAP Labs Berlin


SAP DB is open source. Get it!    www.sapdb.org



_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to