Go to the documentation of this file.
15#error "only WIN32 supported"
37 WORD errlen, errmax =
sizeof (errmsg) - 1;
43 rc = SQLInstallerError(err, &code, errmsg, errmax, &errlen);
44 if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
45 MessageBox(NULL, errmsg, name,
46 MB_ICONSTOP|MB_OK|MB_TASKMODAL|MB_SETFOREGROUND);
50 }
while (rc != SQL_NO_DATA);
66WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
67 LPSTR lpszCmdLine,
int nCmdShow)
69 char tmp[1024], *p, *drv, *cfg, *msg;
72 GetModuleFileName(NULL, tmp,
sizeof (tmp));
78 p = strrchr(tmp,
'\\');
84 if (strstr(p,
"rem") != NULL) {
88 if (strstr(p,
"sys") != NULL) {
89 if (op == ODBC_REMOVE_DSN) {
90 op = ODBC_REMOVE_SYS_DSN;
92 op = ODBC_ADD_SYS_DSN;
95 strncpy(tmp, lpszCmdLine,
sizeof (tmp));
97 i = strspn(tmp,
"\"");
100 i = strcspn(drv,
"\"");
104 i = strcspn(drv,
" \t");
112 if (strlen(drv) == 0) {
113 MessageBox(NULL,
"No driver name given", msg,
114 MB_ICONERROR|MB_OK|MB_TASKMODAL|MB_SETFOREGROUND);
117 i = strspn(cfg,
" \t;");
132 if (SQLConfigDataSource(NULL, (WORD) op, drv, cfg)) {
static BOOL ProcessErrorMessages(char *name)
Handler for ODBC installation error messages.
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
Main function of DSN utility.
Generated on Sun Nov 26 2023 by doxygen.
Contact: chw@ch-werner.de