Hi, I have some C++ Sql code that works great when the target SQL Server is reachable. But when the server is offline, my app crashes in ODBC32.dll when I attempt to SqlDriverConnect. My code is talking to servers all over the place, I have to use tcp. There are no domains, I need to use IPs.
The connection string I am using is:
DRIVER={SQL Server Native Client 11.0};SERVER=tcp:192.168.4.25,1433\myInstance;DATABASE=myDatabase;uid=myUID;pwd=myPWD;
This crash does not happen if I use DRIVER={SQL Server} but this driver is another can o'worms which I'd rather avoid. (problems especially with SqlBindParameter which don't appear when using the native client driver)
Environment:
Unmanaged C++
SQL Server Express 2014
Windows 10
Windows Server 2012
My app is 32 bit for now
This crash occurs both on the Windows 10 platform where I am developing, as well as on the Server 2012 platform where I am testing.
Here's the Windows Error Report from the event log:
Fault bucket , type 0
Event Name: APPCRASH
Response: Not available
Cab Id: 0
Problem signature:
P1: PLCi.exe
P2: 0.0.0.0
P3: 5fa1443c
P4: ODBC32.dll
P5: 10.0.18362.693
P6: 5af6158e
P7: c0000005
P8: 00037d81
P9:
P10:
Attached files:
C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\WER4252.tmp.appcompat.txt
C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\WER4262.tmp.WERInternalMetadata.xml
C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_PLCi.exe_a21a28d48c3f32a4dfb2663ddd2439e9eb73526_35278b99_cab_2dc242be\memory.hdmp
C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_PLCi.exe_a21a28d48c3f32a4dfb2663ddd2439e9eb73526_35278b99_cab_2dc242be\triagedump.dmp
These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_PLCi.exe_a21a28d48c3f32a4dfb2663ddd2439e9eb73526_35278b99_cab_2dc242be
Analysis symbol:
Rechecking for solution: 0
Report Id: 45ce958a-1dcb-11eb-80d8-000c29fdcb11
Report Status: 0
Hashed bucket:
Here's the Application Error entry in the event log:
Faulting application name: PLCi.exe, version: 0.0.0.0, time stamp: 0x5fa1443c
Faulting module name: ODBC32.dll, version: 10.0.18362.693, time stamp: 0x5af6158e
Exception code: 0xc0000005
Fault offset: 0x00037d81
Faulting process id: 0xabc
Faulting application start time: 0x01d6b1d7f8a782ed
Faulting application path: C:\Program Files (x86)\PLCi\PLCi.exe
Faulting module path: C:\Program Files (x86)\PLCi\ODBC32.dll
Report Id: 45ce958a-1dcb-11eb-80d8-000c29fdcb11
Faulting package full name:
Faulting package-relative application ID:
If someone could help me I'd really be much obliged.
Thanks,
Suat