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