DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    John Nelson Guest

    Establishing connection attached ODBC table in VB


    I have several apps. in which I have used attached AS/400 tables in Access
    databases. In my VB app. I have used the following in the past with DAO to
    establish transparent connections:

    Connection = "ODBC;DATABASE=dbname;UID=uid;PWD=pwd;DATABASE=dbname"
    Set opAS400 = wspAS400.OpenDatabase("", False, False, Connection)

    (...where wspAS400 is my DAO workspace...)

    This way I can signon to the AS/400 with a specified username/password, and
    the user never sees a signon dialog for the ODBC driver. How can I do the
    same thing using ADO?

    Many thanks....

  2. #2
    John Nelson Guest

    Re: Establishing connection attached ODBC table in VB


    I mistyped the connection string. The data source name should be in there
    as well...

    John


    "John Nelson" <john.nelson@alliancels.com> wrote:
    >
    >I have several apps. in which I have used attached AS/400 tables in Access
    >databases. In my VB app. I have used the following in the past with DAO

    to
    >establish transparent connections:
    >
    >Connection = "ODBC;DATABASE=dbname;UID=uid;PWD=pwd;DATABASE=dbname"
    >Set opAS400 = wspAS400.OpenDatabase("", False, False, Connection)
    >
    >(...where wspAS400 is my DAO workspace...)
    >
    >This way I can signon to the AS/400 with a specified username/password,

    and
    >the user never sees a signon dialog for the ODBC driver. How can I do the
    >same thing using ADO?
    >
    >Many thanks....



  3. #3
    Shahzad Guest

    Re: Establishing connection attached ODBC table in VB


    Dim CON As Connection

    Set Con = New ADODB.Connection

    Con.ConnectionString="Server=servername;UID=uid;PWD=pwd;DATABASE=dbname"
    Con.Open

    Shahza


    "John Nelson" <john.nelson@alliancels.com> wrote:
    >
    >I have several apps. in which I have used attached AS/400 tables in Access
    >databases. In my VB app. I have used the following in the past with DAO

    to
    >establish transparent connections:
    >
    >Connection = "ODBC;DATABASE=dbname;UID=uid;PWD=pwd;DATABASE=dbname"
    >Set opAS400 = wspAS400.OpenDatabase("", False, False, Connection)
    >
    >(...where wspAS400 is my DAO workspace...)
    >
    >This way I can signon to the AS/400 with a specified username/password,

    and
    >the user never sees a signon dialog for the ODBC driver. How can I do the
    >same thing using ADO?
    >
    >Many thanks....



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links