Results 1 to 9 of 9

Thread: Some ADO Help please

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2001
    Posts
    34

    Some ADO Help please

    I am trying to access a file on an AS400 using ODBC. I was trying to use DAO but someone showed me some code on using ADO. When I put the code into effect it crash and said:

    User Defined type not Defined.

    on the statement:

    Dim objConn as New ADODB.Connection

    Do I need to add a dll or something to use ADO in VB5?
    Josey Wales : "You a bounty hunter?"
    Bounty Hunter : "A man's got to do something for a living these days."
    Josey Wales : "Dying ain't much of a living, boy."

  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Edinburgh, Scotland
    Posts
    272
    Have you added a reference to Microsoft ActiveX Data Objects 2.5 Library?

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2001
    Posts
    34
    I don't have the reference to Microsoft ActiveX Data Objects 2.5, just 2.0 and 2.1. Where can I get that reference, can I download it?
    Josey Wales : "You a bounty hunter?"
    Bounty Hunter : "A man's got to do something for a living these days."
    Josey Wales : "Dying ain't much of a living, boy."

  4. #4
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Edinburgh, Scotland
    Posts
    272
    Version 2.5 is pretty common, but 2.6 is out now. You can install this from a file called mdac_typ.exe, and if you have a service pack for Visual Studio, then you'll probably find it there.

    Go to here and search for mdac. This will give you links for either 2.52 or 2.61.

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2001
    Posts
    34
    Ok that took care of that problem but now I'm getting an error:

    Provider cannot be found.

    on this line of code:

    objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;DSN="EPA"

    What does this mean?
    Josey Wales : "You a bounty hunter?"
    Bounty Hunter : "A man's got to do something for a living these days."
    Josey Wales : "Dying ain't much of a living, boy."

  6. #6
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    FL
    Posts
    258
    If you downloaded ver 2.6 of the MDAC it does not include the latest Jet stuff. MS in their ultimate wisdom took the Jet stuff out of MDAC after ver 2.5. Go back to the MS Data site and get the Jet 4.0 download...

    http://www.microsoft.com/data/

  7. #7

    Thread Starter
    Member
    Join Date
    Feb 2001
    Posts
    34
    As seems to be the case always in programming you fix one problem and another shows its ugly face. Now that the provider error is gone I'm now getting:

    Could not find Installable ISAM.

    what does it mean?
    Josey Wales : "You a bounty hunter?"
    Bounty Hunter : "A man's got to do something for a living these days."
    Josey Wales : "Dying ain't much of a living, boy."

  8. #8
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    FL
    Posts
    258
    First of all your line
    objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;DSN="EPA"
    Has two things wrong...

    1. The quotes are wrong remove the one before EPA.

    2. You are trying to use a connection string with provider and DSN at same time you only need one or the other...
    VB Code:
    1. cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\Biblio.mdb"

    or
    VB Code:
    1. cn.Open "DSN=EPA"

    The DSN knows the rest of the info needed.

  9. #9

    Thread Starter
    Member
    Join Date
    Feb 2001
    Posts
    34
    Thanks All that helped I was really in a Bind.
    Josey Wales : "You a bounty hunter?"
    Bounty Hunter : "A man's got to do something for a living these days."
    Josey Wales : "Dying ain't much of a living, boy."

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