howdy
when trying to create a linked table in Access97 that is linked to a public folder on the Exchange Server, I keep getting "Error 3305 - Invalid connection string in pass-through query".
I copied the code from an MSDN Library article.
I have used the Microsfot Exchange and Outlook Wizard add-on tool & that works fine. What I want to do is link the table as an ADDRESS Book format [Table Type = 1] (as opposed to the wizard default of a message format [Table Type = 0]) .. thereby having access the fields I need in my application.
Here is the code I am using:
Function LinkExchangeFolder()
Dim dbs As Database
Dim tdf As TableDef
Dim str As String
Const conTableExists = 3012
On Error GoTo Link_Err
' Set a reference to the current database.
Set dbs = CurrentDb
' Build the connection string.
str = "Exchange 4.0;MAPILEVEL=Public Folders|All Public Folders\Mid-Atlantic District\;PROFILE=NRC;TABLETYPE=1;DATABASE=C:\WINDOWS\DESKTOP\MAD SDS.mdb;TABLE=MAD NWOs;"
' Create a TableDef object. The name specified for the
' TableDef object is displayed as the name of the link
' in the Database window.
Set tdf = dbs.CreateTableDef("MAD NWOs"
' Set connection information and specify
' a personal address book.
tdf.Connect = str
tdf.SourceTableName = "MAD NWOs"
' Append the TableDef object to create the link.
dbs.TableDefs.Append tdf
' Refresh the database window and clear
' the database object variable.
RefreshDatabaseWindow
Debug.Print
Link_Exit:
dbs.Close
Set dbs = Nothing
Exit Function
Link_Err:
If Err = conTableExists Then
MsgBox "The table you are trying to create already exists. "
Resume Link_Exit
Else
MsgBox "Error: " & Err.Number & ": " & Err.Description
End If
End Function
It goes to ERROR at the line highlighted in red
What confuses me most is that the connection string that I can cature in debug is exactly the same as the connection property of a linked table that I create using the wizard
can anyone help me figure out why ?
thanks for any & all assitance
tim it's a small world ...
... but i wouldn't want to paint it
when trying to create a linked table in Access97 that is linked to a public folder on the Exchange Server, I keep getting "Error 3305 - Invalid connection string in pass-through query".
I copied the code from an MSDN Library article.
I have used the Microsfot Exchange and Outlook Wizard add-on tool & that works fine. What I want to do is link the table as an ADDRESS Book format [Table Type = 1] (as opposed to the wizard default of a message format [Table Type = 0]) .. thereby having access the fields I need in my application.
Here is the code I am using:
Function LinkExchangeFolder()
Dim dbs As Database
Dim tdf As TableDef
Dim str As String
Const conTableExists = 3012
On Error GoTo Link_Err
' Set a reference to the current database.
Set dbs = CurrentDb
' Build the connection string.
str = "Exchange 4.0;MAPILEVEL=Public Folders|All Public Folders\Mid-Atlantic District\;PROFILE=NRC;TABLETYPE=1;DATABASE=C:\WINDOWS\DESKTOP\MAD SDS.mdb;TABLE=MAD NWOs;"
' Create a TableDef object. The name specified for the
' TableDef object is displayed as the name of the link
' in the Database window.
Set tdf = dbs.CreateTableDef("MAD NWOs"
' Set connection information and specify
' a personal address book.
tdf.Connect = str
tdf.SourceTableName = "MAD NWOs"
' Append the TableDef object to create the link.
dbs.TableDefs.Append tdf
' Refresh the database window and clear
' the database object variable.
RefreshDatabaseWindow
Debug.Print
Link_Exit:
dbs.Close
Set dbs = Nothing
Exit Function
Link_Err:
If Err = conTableExists Then
MsgBox "The table you are trying to create already exists. "
Resume Link_Exit
Else
MsgBox "Error: " & Err.Number & ": " & Err.Description
End If
End Function
It goes to ERROR at the line highlighted in red
What confuses me most is that the connection string that I can cature in debug is exactly the same as the connection property of a linked table that I create using the wizard
can anyone help me figure out why ?
thanks for any & all assitance
tim it's a small world ...
... but i wouldn't want to paint it