 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Daryl Guest
|
Posted: Tue Apr 24, 2007 2:44 pm Post subject: ODBC API Problem, looking for SQL Servers - local, remote OK |
|
|
Hi
I have a problem with an application that I have been using for quite a time
with WIN 2000, 2003, XP. I am now having a problem with it using Borland
Builder ver 5 to compile on Vista Buisness and a local install of Microsoft
SQL Server 2005.
The application uses the ODBC API to browse for SQL servers. The problem is
that when it browsers for SQL servers the local server is shown as (loc not
(local) or NOAH which is its name. The code that returns the string that
contains the servers is shown below.
//---------------
bool __fastcall TfrmFindServer::FindServers(TStringList *sl, String StrIn)
{
// Only looks for SQL SERVER(S) on the network.
RETCODE rc1, rc2;
bool SUCCESS = true;
// Get initial response, discover available servers
lstrcpy(szConnStrIn, StrIn.c_str());
rc1 = SQLBrowseConnect(hdbc, szConnStrIn, SQL_NTS, szConnStrOut,
sizeof(szConnStrOut),
&cbConnStrOut);
if (rc1 == SQL_SUCCESS || rc1 == SQL_NEED_DATA) {
i=1;
while ((rc2 = SQLGetDiagRec(SQL_HANDLE_DBC, hdbc, i, SqlState,
&NativeError,
Msg, sizeof(Msg), &MsgLen)) != SQL_NO_DATA)
{
DisplayError_(SqlState, NativeError, Msg, MsgLen);
i++;
}
ProcessReturnString(szConnStrOut, sl);
}
else
SUCCESS = false;
return SUCCESS;
}
// ------------------------
String StrIn is set to "DRIVER={SQL Server};"
The variable szConnStrOut returns "SERVER=Server={(loc, NOAH\\MSSMLBIZ};...
when parsed for the servers the local server becomes (loc
Any help or direction would be very good.
thanks
daryl |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|