Results 1 to 8 of 8

Thread: ODBC DSN List

  1. #1

    Thread Starter
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    I have some code to access the DSNs on the local machine, but I am getting an error

    Code:
        Dim objDSN As Dsn
        Dim strDSArray() As String
        Dim I As Long
        
        Set objDSN = New Dsn
        
        objDSN.GetDataSourceList strDSArray()
        
        'list drivers
        
        'list dsns
        For I = LBound(strDSArray) To UBound(strDSArray)
            lstDNS.AddItem strDSArray(I)
        Next I
    I just need to know what reference I need to add to access the Dsn. I get an error that user-type not defined.

    Thanks in advance

  2. #2
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274
    As far as I know, there is not a DSN dataa type. May be it could be posible by another way. What exactly do you want to do? Do you want a list of DSN or alist of ODBC drivers?
    Ulises Vázquez
    [size=1.7]Oracle DBA Certified Professioanl
    Visual Basic 6 Developer
    Crystal Reports Designer
    [/size]

  3. #3

    Thread Starter
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    I just want the DSN's. I got this code off this site and nobody said what references you need to make to get this code to work.

  4. #4
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274
    You can get them from registry.

    The User DSN are in:
    HKEY_CURRENT_USER\Software\ODBC\ODBC.INI

    The System DSN are in:
    HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI

    Good Look!
    Ulises Vázquez
    [size=1.7]Oracle DBA Certified Professioanl
    Visual Basic 6 Developer
    Crystal Reports Designer
    [/size]

  5. #5
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Add a reference to:

    ODBC Driver & Data Source Name Functions

  6. #6

    Thread Starter
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    That reference is not in my references list. What is the DLL that is associated with that reference.

  7. #7
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274
    In my PC is: \Windows\System\msado15.dll

    Maybe you need to install the MDAC. You can download it from microsoft page.
    Ulises Vázquez
    [size=1.7]Oracle DBA Certified Professioanl
    Visual Basic 6 Developer
    Crystal Reports Designer
    [/size]

  8. #8

    Thread Starter
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Thanks guys you helped out a lot.

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