teikmeng
April 26th, 1999, 04:01 PM
Hi there:
I am trying to use SQLDataSources to get a list of all the DSN configured on a computer. I am using the following code but the program keeps crashing. Any ideas?
RETCODE retcode;
HENV henv;
UCHAR FAR *DataSourceNames;
SWORD FAR *pcbDSN;
unsigned char *szDescription;
SWORD FAR *pcbDescription;
retcode = SQLAllocEnv(&henv);
if(retcode != 0)
{
AfxMessageBox("SQLAllocEnv Error");
return;
}
// I managed to get pass the SQLAllocEnv function with no errors but immediately
// crashed the program with the next function.
retcode = SQLDataSources(henv,
SQL_FETCH_FIRST,
DataSourceNames,
1024,
pcbDSN,
szDescription,
255,
pcbDescription);
Thanks in advance.
Teik
I am trying to use SQLDataSources to get a list of all the DSN configured on a computer. I am using the following code but the program keeps crashing. Any ideas?
RETCODE retcode;
HENV henv;
UCHAR FAR *DataSourceNames;
SWORD FAR *pcbDSN;
unsigned char *szDescription;
SWORD FAR *pcbDescription;
retcode = SQLAllocEnv(&henv);
if(retcode != 0)
{
AfxMessageBox("SQLAllocEnv Error");
return;
}
// I managed to get pass the SQLAllocEnv function with no errors but immediately
// crashed the program with the next function.
retcode = SQLDataSources(henv,
SQL_FETCH_FIRST,
DataSourceNames,
1024,
pcbDSN,
szDescription,
255,
pcbDescription);
Thanks in advance.
Teik