Re: Database path from DSN (MSDE) (2nd. attempt)
- From: "Tim" <Tim@NoSpam>
- Date: Wed, 22 Jun 2005 20:01:35 +1200
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
.
- Follow-Ups:
- Re: Database path from DSN (MSDE) (2nd. attempt)
- From: Peter Scholl
- Re: Database path from DSN (MSDE) (2nd. attempt)
- References:
- Database path from DSN (MSDE) (2nd. attempt)
- From: Peter Scholl
- Database path from DSN (MSDE) (2nd. attempt)
- Prev by Date: Re: Display Unicode In Richedit Conrol
- Next by Date: Q: writing to STDOUT/STDERR from MFC application ?
- Previous by thread: Database path from DSN (MSDE) (2nd. attempt)
- Next by thread: Re: Database path from DSN (MSDE) (2nd. attempt)
- Index(es):
Relevant Pages
|