all groups > dotnet academic > march 2004 >
You're in the

dotnet academic

group:

Question About oledb



Question About oledb Gina L. Hernandez
3/10/2004 2:06:00 PM
dotnet academic: 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

Re: Question About oledb William Burrows [MVP]
3/10/2004 8:15:54 PM
Hi Gina,

From http://www.able-consulting.com/ado_conn.htm?f=ado_conn.htm

a.. OLE DB Provider for AS/400 (from IBM)
oConn.Open "Provider=IBMDA400;" & _
"Data source=myAS400;" & _
"User Id=myUsername;" & _
"Password=myPassword"For more information, see: A Fast Path to
AS/400 Client/Server

bill burrows

[quoted text, click to view]

AddThis Social Bookmark Button