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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Failed to open rowset (using multiple tables from AS400)

Status
Not open for further replies.

ajonesprogrammer

Programmer
Nov 8, 2005
3
US
I am using VS.NET 2003 and am creating a crystal report. I can create the report fine. I call the report and set the record source using Crystal Report Viewer in VB.NET on a form. The code for the call is below:

Dim rpt as new CrystalReport1 'My Report
Try

myconn.Open()
With cmd
.CommandText = "Select PARNT, '(' || Trim(PARNT) || ')' as " & _
"DSPPARNT,CHILD, 'P' || CHILD as BARCHILD,DESCP,DSCPS,PSREQ from RMSFILES#.PSPSP100 as PSPSP100 " & _
"inner join RMSFILES#.MSPMP100 as MSPMP100 on PSPSP100.CHILD=MSPMP100.PRDNO where " & _
"PARNT in ('SPO15N310BL'," & ParentList & ")"
.CommandType = CommandType.Text
.Connection = myconn
End With

adp.Fill(dt)
rpt.SetDataSource(dt)

CrystalReportViewer1.ReportSource = rpt

Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try

Now when I try to run this code and call the report I get an error saying "Failed to open rowset".

On the crystal report I am using two (2) tables from our AS400 system and have attached fields from both of those tables onto the report form.

What the heck is going on?

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top