OLEDB Connection and Query questions

11-21-2013 06:24 AM
Occasional Contributor III

System Information:
ArcGIS 10.2, Windows 7, SQL Server Express 2012.
ArcGIS 10.1 SP1, Windows Server 2008 R2 SP1, SQL Server Express 2012.

I'm looking for some assistance on creating an OleDB connection to SQL Server 2012 Express. I'm currently using the below connection string:
return string.Format("Provider=ESRI.GeoDB.OleDB.1;Location={0};Data Source={4};Version={3};Extended
Geometry=WKB", p_Server, p_Username, p_Password, p_Version, p_Database);

Which when executed pops up a Database Connection dialog box with the Authentication Type of Database Authentication. I'm able to provide a user name and password and the connection then opens. However, I would like the connection to use Windows Authentication. Is it possible to alter the connection string such that it uses the Windows Authentication and avoids the Database Connection dialog?

Once connected I intended to use the connection in a READ ONLY format. Is it possible to run queries that contain table aliases and left outer join statements?  Currently when I use OleDbDataReader the query fails. Yet, the query is successful when executed in SQL Server Management Studio. When I make my connection I'm doing so from within ArcMap with an edit session started. So I don't believe I need to check out a license, correct?

I've done extensive research but haven't yielded any recent results. Any assistance you might be able to provide would be greatly appreciated.

Thank You, G
0 Kudos
0 Replies