开发者

Problem with SQLBrowseConnect

开发者 https://www.devze.com 2023-01-14 22:18 出处:网络
I\'m making a call to odbc32.dll (SQLBrowseConnect) to return a list of databases on a sql server. From running a trace I can see the query being executed is

I'm making a call to odbc32.dll (SQLBrowseConnect) to return a list of databases on a sql server.

From running a trace I can see the query being executed is

select name from master..sysdatabases where has_dbaccess(name)=1

If the credentials I pass aren't the sa user it returns just the system databases. Is there anyway I can use SQLBrowseConnect with another user (whose default database is also not guarenteed to be the master database) to return all databases on the server?

Also I want to avoid s开发者_StackOverflow社区mo objects


In our ETL tools we do use SQLBrowseConnect to get a list of available SQL servers.

We do not use it for getting list of the databases

SQLExecDirect(FHSMT,PAnsiChar ('select name from MASTER.dbo.sysdatabases order by name'), SQL_NTS)

We use different ODBC driver for different versions of SQL server.

0

精彩评论

暂无评论...
验证码 换一张
取 消