Hello guys
I connect to microsoft sql server using this code:
wchar_t * sConStr = L"Driver={SQL SERVER};Server=MyServer;DataBase=MyDB;UID=;PWD=;";
wchar_t wszOutStr[256];
SQLRETURN retcode;
retcode = SQLDriverConnectW(m_hdbc, hWndMain, sConStr, wcslen(sConStr),
wszOutStr, countof(wszOutStr), &uOutLen,
SQL_DRIVER_NOPROMPT
);
The connection takes two long(45 seconds today, 3 seconds yesterday).
I searched google to find proper connection strings, but most found was using odbc DSN, which I don't want to use. I want to connect directly to an existing database.
Can any one show me the right way to connect? any replies appreciated.
I'm new to odbc.
mr.abzadeh
Edit:
I found that I first I must connect to sql server, and then connect to database.
How can I connect in C? google search shows many ado.net results, which I don't want
mr.abzadeh