Re: Database path from DSN (MSDE) (2nd. attempt)



The path is in the master database... There can be multiple paths...

try running a query as follows:

select filename from master..sysdatabases where name = 'your db name'

Now comes the question: Why on earth would you want to know that in a client
application? This tends to indicate to me that you are possibly not using
the right tool for the right job. Nothing on the client side needs to know
this and should not know this for normal applications (security) ==> not a
normal application.

- Tim



"Peter Scholl" <delete.this.pscholl@xxxxxxxxxxx> wrote in message
news:9v1ib1dh7ogt3059pr9sn8nhh3j1v1k2mb@xxxxxxxxxx
> I'm trying to get the full path of my .mdf database from a DSN on a
> shared WinXP drive (running MSDE).
> I've tried the following: (using MFC6, SP6)
>
> SQLGetInfo(g_db.m_hdbc, SQL_DATABASE_NAME, &sMyDatabase, lSize,
> &bytesreturned);
> SQLGetConnectAttr(g_db.m_hdbc, SQL_CURRENT_QUALIFIER, &sMyDatabase,
> lSize, &lLengthReturned);
> SQLGetConnectAttr(g_db.m_hdbc, SQL_ATTR_CURRENT_CATALOG,
> &sMyDatabase, lSize, &lLengthReturned);
>
> All the functions return the name of the database but not the path.
> The path is not in the registry so I can't use those functions either.
> Any help would be very much appreciated


.



Relevant Pages