Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to A/S 400 with ADO 1

Status
Not open for further replies.

rss01

Technical User
Oct 10, 2001
125
US
I am trying to connect from Access to an A/S 400 database and would prefer not to use ODBC. Does anyone know ADO code to establish a connection to query A/S 400 tables/views?

Thanks
 
Here you go. Here is the way I use it in my code:
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim cmd As ADODB.Command
Dim cnndb As ADODB.Connection
Dim rstdb As ADODB.Recordset
Dim var As Variant
Dim i As Long

'Get Plants
Set cnn = New ADODB.Connection
cnn.Open "Provider=IBMDA400;Password=;User ID=;Data Source="Your AS400";Transport Product=Client Access;SSL=DEFAULT"

Set rst = New ADODB.Recordset
rst.ActiveConnection = cnn
rst.Open "Select YOURLIB.YOURFILE.* from YOURLIB.YOURFILE"

Additional info can be found at:

 
Thanks, I'm working on it now.
 
How do I get it to work with Access97? My system does not recognize the ADO* verbage.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top