I am running a simple test app that opens an OLEDB connection, retrieves a single value, then closes. The compiled (console) app works fine, but running it from the IDE causes either a silent close (if it’s a winforms app) or a crash of vshost32.exe if it’s a console app.
The devenv is VB 2010 Express on Windows x64, but I have the configuration manager on the solution set to “Debug” – “x86”.
Imports System.Data.OleDb
Module Module1
Sub Main()
Dim server As String = "xxxxx"
Dim username As String = "xxxxx"
Dim password As String = "xxxxx"
Dim schema As String = "xxxxx"
Dim connectionString As String = String.Format( _
"Provider=SLXOLEDB.1;Data Source={0};Initial Catalog={3};User ID={1};Password={2};Extended Properties=LOG=ON;Connect Timeout=5;", _
server, username, password, schema)
Dim con As OleDbConnection = New OleDbConnection(connectionString)
con.Open()
Dim query As String = "SELECT USERID FROM USERSECURITY WHERE USERCODE=?"
Dim cmd As New OleDbCommand(query, con)
cmd.Parameters.AddWithValue("usercode", username)
Dim userid As String = cmd.ExecuteScalar.ToString
Console.WriteLine("UserID is {0}", userid)
cmd.Parameters.Clear()
con.Close()
con = Nothing
End Sub
End Module
Solution was simple.
The SalesLogix OLEDB provider works fine, but you can only debug if the IDE is launched with Administrator permissions.
Some digging around with procmon would probably tell which keys/files are being accessed, but in our case I can just debug with an elevated IDE.