on 11-10-2011 7:32 AM
Experts,
How many ways we can use recordset for DOQuery
1. Select Field1 from Table1 (Need to display all value returned in mesageBox)
2. Select Field1, Field2, ..... from Table1 (Need to display all value returned in mesageBox)
Hi,
Try This......
Dim orecordset As SAPbobsCOM.Recordset
Dim strarr As String = ""
orecordset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
orecordset.DoQuery("select cardcode from ocrd")
If orecordset.RecordCount > 0 Then
While orecordset.EoF = False
If strarr.Length = 0 Then
strarr = orecordset.Fields.Item(0).Value
Else
strarr = strarr + "|" + orecordset.Fields.Item(0).Value
'strarr = strarr & vbCrLf & orecordset.Fields.Item(0).Value
End If
orecordset.MoveNext()
End While
MessageBox.Show(strarr)
End If
Thanks
Shafi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can follow the above procedure if you want to display the value in single cell i.e. by concatenating the values or if you want them if different cells just assign the recordeset value to that cell with a loop on the recordeset.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.