Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can I find out if a driver is in my pc?
Driver that I must search for is "mysql-connector-odbc-5.1.8-win32.msi"
Can I search out if I don't know path?

What I have tried:

I tried code that I found in internet but it doesn't work
Posted
Updated 18-Jan-22 6:58am
Comments
PIEBALDconsult 18-Jan-22 11:22am    
DIR /S C:\mysql-connector-odbc-5.1.8-win32.msi
Member 14594285 18-Jan-22 11:51am    
so Must I write :
if PathFileExists(_T("/S C:\mysql-connector-odbc-5.1.8-win32.msi");?

Quote:
Driver that I must search for is "mysql-connector-odbc-5.1.8-win32.msi"
That's not a driver name. That's the filename of the installer to install a MySql driver.
 
Share this answer
 
Repost of Driver mysql mfc C++[^].
 
Share this answer
 
Comments
Member 14594285 18-Jan-22 11:48am    
I saw in internet that I can use

SQLGetInstalledDriversW ( LPWSTR lpszBuf,
WORD cbBufMax,
WORD * pcbBufOut
)

but I don't understand how use this function
Member 14594285 18-Jan-22 12:06pm    
yes But I don't know how I must inizialized lpszBuf, cbBufMax and pcbBufOut
Richard MacCutchan 18-Jan-22 12:16pm    
As I already stated, the documentation explains the use of each parameter.
lpszBuf must be a pointer to a buffer that will get the returned names.
cbBufMax is the length of this buffer.
pcbBufOut is the address of a WORD variable that is set by the API to the number of bytes returned.
Member 14594285 20-Jan-22 3:11am    
TCHAR szBuf[2001];
WORD cbBufMax = 2000;
WORD cbBufOut;
TCHAR *pszBuf = szBuf;

/*LPSTR lpszBuf,
WORD cbBufMax,
WORD * pcbBufOut);

if (SQLGetInstalledDrivers(szBuf, cbBufMax, &cbBufOut))
{
int i = 1;
}

but I have this error: Severity Code Description Project File Line Column Suppression State
Error LNK2019 unresolved external symbol _SQLGetInstalledDriversW@12 referenced in function "protected: virtual int __thiscall CCReadLogDlg::OnInitDialog(void)" (?OnInitDialog@CCReadLogDlg@@MAEHXZ) CReadLog C:\Dev2015\Prg\CReadLog\CReadLogDlg.obj 1 1

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900