BOOL SQLConfigDataSource(
   HWND   hwndParent,
   WORD   fRequest,
   LPCSTR   lpszDriver,
   LPCSTR   lpszAttributes);下面这样写正确,ee返回值是1;
但我的SERVER名是不定的, 我想用gethostname()取,
然后拼成串lpszAttributes,做了两天不成,int ee=SQLConfigDataSource(NULL,ODBC_ADD_DSN,
                       (LPSTR)"SQL Server",
                       (LPSTR)"DSN=student\0"
                       "SERVER=px09\0"
                       "DATABASE=student\0");大家帮我看看吗,我是这样拼的
char *as="DSN=student\0";
char *bs="SERVER=px09\0";
char *cs="DATABASE=student\0";
LPSTR lpszAttributes;strcat(lpszAttributes,as);
strcat(lpszAttributes,bs);
strcat(lpszAttributes,cs);
SQlconfigdatasource(,,,lpszAttributes);//返回值为0