Ok, so this is how I solved this problem. When the user hits the login button, at the time I make the connect statement I check for the error of the missing drivers.
connect using SQLCA;
If sqlca.sqlcode < 0 Then
// test to see if the windows 64 msoledbsql.dll is missing, this creates the error sqldbcode = 999
if sqlca.sqldbcode = 999 then
i = run("move_sql_dll.bat", Minimized!)
Messagebox("Software Upgrade","Your computer is missing the Microsoft Software to connect to SQL Server. RMS will shut down, please try again AFTER the MS Installation window disappears.",Information!,Ok!)
disconnect;
return
end if
I copied the installation MSI program in a subfolder called sql_drivers. I call a BAT file located in the same directory as the application EXE. The bat file has these commands
cd sql_drivers
msiexec /i "msoledbsql_V18.2.3.0.msi" /passive IACCEPTMSOLEDBSQLLICENSETERMS=YES
cd ..
The run function in PB returns a 1 for success in calling the BAT file, but that is it. There is no way for me to wait for the install to finish and try connecting again, which is why I put up the Popup window. After the SQL Drivers install the user can hit the login button again and get connected.
Not the cleanest method and I expect my users to call once they get the popup because they will not read it, but this is better than visiting all computers in the company and dealing with their login and such.
Hope this helps someone else.
NOTE: I changed the name of the msoledbsql program so I know what version we are loading.