How to Detect Trusted Connection in Crystal Reports using VB.NET?
Posted
by Michael
on Stack Overflow
See other posts from Stack Overflow
or by Michael
Published on 2010-03-28T13:04:43Z
Indexed on
2010/03/28
13:13 UTC
Read the original article
Hit count: 211
I have some Crystal Reports connecting to a Sql Server db that I would like to detect whether the connection is trusted or whether I need to supply the log on info (reports are not supplied by me so I can't control the connect method). If I just blindly supply login credentials, it won't connect if it is a trusted connection.
The following does not work:
oRpt = oCR.OpenReport("C:\MyReport.rpt")
if oRpt.Database.Tables(1).ConnectionProperties.Item("Integrated Security") = True then
'trusted connection
else
'supply login credentials
end if
It gives the following error: Operator '=' is not defined for type 'IConnectionProperty' and type 'Boolean'.
I cannot find how create a construct in vb.net for IConnectionProperty. I can't find any documents from Crystal that explain it. I am using Crystal Reports XI - Developer
© Stack Overflow or respective owner