-
AS400 Connections
Hi,
Does anyone know how to send a command to an AS400?
i have to link to a DB2 Database o the AS400 and, thogh i have the connection sorted, i don't know how to get the data from the database. i am using ADO with an ODBC connection
Thanks in advance
Dan
-
So, if you have a connection to the database, you can get a list of tables, right?
-
i could do, but i don't know how.. thogh when i was experimenting with the AS400 SDK it was picking up files etc.
the problem i have is not really knowing how to send commands to the AS400 through ADO...
any ideas..?
-
OK, have you any experience with ADO on, say, SQL Server, Access, Oracle?
I have to ask these questions, because if you have no experience with ADO, you got a big learnign curve to climb...
-
i have use ADO with Access about 2 or 3 years back, only recently got back into VB so i am a little rusty shall we say.
i know there is going to have to be a steep learning curve, but i cannot find anywhere to get that learning from. :(
-
connection AS400
you need the connection string (from a dsn) and then open the connection object. You can manage too recordsets objects...
Daniel
-
Where I'm coming from is this:
If you already have a connection to AS400 via ADO, then the utilisation of ADO commands
should (if you follow Microsoft's mantra of many databases, one data access method) be the same as ADO with Access etc...
So what I don't understand is that if you have your AS400 connection, and you have some ADO experience, then what's the sticking point?
Can you post your ADO connection string?
Cheers
-
The Sticking point is, having used ADO with Access so long ago,
i can't honestly remember much about it.
Do i need to define a variable as the Datafield or something.?
Anyhow, here is my Connection string, and amazingly it does appear to work...
cnTYPHOON.ConnectionString = "DSN=AS400;DRIVER={client Access ODBC data source};" & _
"SERVER=typhoon;DATABASE=DANLIB;UID=" + strUserID + ";Password=" + strPassword + _
";"
Thanks For your help
Dan
-
Ah, gotcha :)
OK,
cnTyphoon.Open will get the connection open.
After that, you can perform straight SQL using
cnTyphoon.Execute "delete * from mytable"
Or recordset manipulation;
Dim cnTyphoon as New adodb.connection
dim rs as new adodb.recordset
cntyphoon.connectionstring = blah blah
cntyphoon.open
rs.Open "select * from mytable", cn, adOpenKeyset, adLockOptimistic
etc etc
Take a look at the ADO tutorial on VB World too - starts from the basics again...
-
Spot on, it works, thanks a lot Gaffer for your help!!!
Much appreciated! :D
Dan:)