I have been trying to access the Group table in a Notes Address book and keep running into problems. I have installed NotesSQL 3.02g, created a linked server in Microsoft SQL Server and am able to access certain tables like Location and Person. When I try to access the Group table with the following SQL statement:SELECT * FROM CORPORATEADDRESSBOOK…Group, I get the error message “Incorrect syntax near the keyword ‘Group’.”. I believe I am receiving this error because ‘Group’ is a reserved word.
I thought I could resolve the problem by placing square brackets around ‘Group’ such as SELECT * FROM CORPORATEADDRESSBOOK…[Group]. Now I receive the following:
Server: Msg 7306, Level 16, State 2, Line 1
Could not open table ‘Group’ from OLE DB provider ‘MSDASQL’. The specified table does not exist.
[OLE/DB provider returned message: [Lotus][ODBC Lotus Notes]Table reference has to be a table name or an outer join escape clause in a FROM clause]
OLE DB error trace [OLE/DB Provider ‘MSDASQL’ IOpenRowset::OpenRowset returned 0x80040e37: The specified table does not exist.].
Has anyone been able to reference the ‘Group’ table using NotesSQL? Is there a workaround that can be suggested?
Thanks in advance!
Subject: SQL Server and Group Table in Address Book
I’m not sure if all versions of the Names and Address book have the same aliases, but looking at mine, the following aliases are ok for the form Group:Group | Distribution List | Access Group | Access List | Group
So, if you change your SQL Statement to SELECT * FROM CORPORATEADDRESSBOOK…Access_List … that should work.
Ron
Subject: RE: SQL Server and Group Table in Address Book
Ron,Thanks! I am able to select using the Access_List alias.
Two questions:
Do you know if I can issue update statements using the alias name?
Where do I see the alias names that you have listed?
TIA!
Scott
Subject: RE: SQL Server and Group Table in Address Book
You should be able to update via aliases, it shouldn’t matter.
As for the aliases, in Domino Desiner, you would have to open up the Form being used and look at it’s properties, the aliases are listed there in the name field, seperated by pipes (|).
In a pure ODBC environment, you can call the ODBC API SQLStatistics and it will list Aliases with the tables as well and tell you what tables they are aliases of, this is a function of ODBC itself, not NotesSQL (well, NotesSQL reports info back to the ODBC APIs). Any app you have that can list the tables in an ODBC DSN should list the aliases as well (Like Excel, Word, etc).
Ron