S
Scott Johnson
Hi
I have been pulling my hair out for the past week trying to call a program
(or a query, or CL etc) on an iSeries (as400) from VB.NET and I just can't
get it. Jay had written me back and told me to treat it like a
StoredProcedure, which I will include a sample of my error-generating code
below, but it still doesn't work.
Does anyone have a sample of code they could share to show me the light or
have any suggestions?
'** Code Sample Generates
Dim cn As New System.Data.Odbc.OdbcConnection
cn.ConnectionString = "DSN=SA;UID=XXXX;PWD=XXXX;"
cn.Open()
Dim cmd As New System.Data.Odbc.OdbcCommand
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "{{ RUNQRY QRY(SCOOTER/SAJTEST) }}"
cmd.ExecuteNonQuery()
'** Cleanup, etc
MsgBox("done")
I get an unhandled exception of System.Data.Odbc.OdbcException in
system.data.dll and additional information: System Error on the line
ExecuteNonQuery. SA is a DSN to my as400 using iSeries Access ODBC driver
version 9.00.05.00 for V5R2M0
Thanks for your help!
--Scott
I have been pulling my hair out for the past week trying to call a program
(or a query, or CL etc) on an iSeries (as400) from VB.NET and I just can't
get it. Jay had written me back and told me to treat it like a
StoredProcedure, which I will include a sample of my error-generating code
below, but it still doesn't work.
Does anyone have a sample of code they could share to show me the light or
have any suggestions?
'** Code Sample Generates
Dim cn As New System.Data.Odbc.OdbcConnection
cn.ConnectionString = "DSN=SA;UID=XXXX;PWD=XXXX;"
cn.Open()
Dim cmd As New System.Data.Odbc.OdbcCommand
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "{{ RUNQRY QRY(SCOOTER/SAJTEST) }}"
cmd.ExecuteNonQuery()
'** Cleanup, etc
MsgBox("done")
I get an unhandled exception of System.Data.Odbc.OdbcException in
system.data.dll and additional information: System Error on the line
ExecuteNonQuery. SA is a DSN to my as400 using iSeries Access ODBC driver
version 9.00.05.00 for V5R2M0
Thanks for your help!
--Scott