For a particular dsn how to extract the database name with path to which it is
configured.(Access database)?
Printable View
For a particular dsn how to extract the database name with path to which it is
configured.(Access database)?
If you kindly tell me what excatly you want. I think I can help you out...
By giving configured DSN name you can get the the path of the database..using a library function
regards
Hi,
If you are talking about a .dsn file, it is easy.
You can access .dsn file like a INI file using the corresponding API's.
Below an example:
Dim Ret as string, NC as Long
'Create a buffer
Ret = string(255, 0)
'Retrieve the string
NC = GetPrivateProfileString("ODBC", "DBQ", "Default", Ret, 255, "C:\test.dsn")
'NC is the number of characters copied to the buffer
If NC <> 0 then Ret = Left$(Ret, NC)
'Show our string
MsgBox Ret