Establishing connection attached ODBC table in VB


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Establishing connection attached ODBC table in VB

Hybrid View

  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....



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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center