CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 1999
    Posts
    1

    extracting databasename from the configured dsn





    For a particular dsn how to extract the database name with path to which it is

    configured.(Access database)?



  2. #2
    Join Date
    Nov 2001
    Posts
    2

    Re: extracting databasename from the configured dsn

    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




  3. #3
    Join Date
    Nov 2001
    Location
    Begium
    Posts
    3

    Re: extracting databasename from the configured dsn

    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








Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured