PROBLEMS CONNECTING AS/400 with VB.NET application

G

Gina L. Hernandez

Hello:

I am creating an application in .NET (Visual .NET) and I need to connect a
PC to a AS/400. I wrote my code and compile, but when I am executing the
programs I have problems trying to reach the data stored in my
oledbdatadapter da.fill(dataset). If I use a recordset it says ""ERRORValue
cannot be null parameter dataset". If I use a New dataset it says
"ERROROleDbDataAdapter internal error: invalid rowset accessor: Ordinal=3
Status=UNSUPPORTEDCONVERSION."

This is the syntax I am using

Dim oOleDbConnection As New OleDbConnection



Dim sConnString As String = "Provider=IBMDA400;" & _

"Password=password;" & _

"User ID=userid;" & _

"Data Source=as/400;" & _

"Transport Product=Client Access;" & _

"SSL=DEFAULT"

oOleDbConnection = New OleDb.OleDbConnection(sConnString)

oOleDbConnection.Open()



Try

Dim myQuery As String = "SELECT ZAITEM, ZALOC,ZAQTY,ZAWET FROM
PRDAURF3.INP77U0B " & "WHERE ZABAR = '" & Trim(vIncoming) & "'"

Dim da As New OleDb.OleDbDataAdapter '(myQuery, oOleDbConnection)
'sConnString)

da.SelectCommand() = New OleDbCommand(myQuery, oOleDbConnection)

Dim cb As New OleDb.OleDbCommandBuilder(da)

Dim mytable As DataTable

Dim mydataset As New DataSet

Dim myrow As DataRow

Dim t_messtext As StringBuilder = New StringBuilder

Dim temp As Decimal

Dim SQL As String

Dim result As String

Dim mySQLDA As New SqlDataAdapter

Dim mySQLDS As New DataSet

Dim mySqlCmd1 As New SqlCommand

da.Fill(mydataset)

mytable = mydataset.Tables(0)

myrow = mytable.Rows(0)

Does somebody have and idea about what the problem is and can help me to
solve this??

Thanks
 
W

www.eztree-msdn.com \(Laurent Jordi\)

I had this problem also...

The solution I found was to generate xml page with a netdata (native as400
web server) parser .

I transfomed the as400 in a web query server... someting like a big web
service. We submitted our queryes to the net data server. And we get back
xml pages. It's very easy tu use xml with vb dot net...

The advantage of this solution is to avoid to pay on as400 client acces
licence for each user... It's a bit slower than a direct access but if you
have 20 or 30 users it work well...

Regards...

LJ

www.eztree-msdn.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top