Author Message
 Posted 4/17/2012 1:45:04 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 11/13/2014 12:18:02 AM
Posts: 6, Visits: 90
Why If I use this code it always return that the data is not finded?

        If BoReport1.Seek("report_nbr='12'") Then
            '-- Ensure the product is active
            MsgBox("Report 11 found")
            'ProductsBO1.prod_isactive = True
        Else
            MsgBox("Report 11 not founded")

        End If

Even the record exist in the table


Tags:
Post #31141
Add to Twitter Add to Facebook
 Posted 4/17/2012 2:29:27 PM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
Hi Javier.

If report_nbr is a character type, it should work, if it is an integer, for example, you should use:

        If BoReport1.Seek("report_nbr = 12") Then
            MsgBox("Report 12 found")
        Else
            MsgBox("Report 12 not found")
        End If
Post #31142
Add to Twitter Add to Facebook
 Posted 4/17/2012 2:32:09 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 2/14/2020 3:30:44 AM
Posts: 2,430, Visits: 23,867
Hi Javier,
Just to clarify, you are trying to locate a record in BoReport1 where report_nbr = '12', now in your MessageBox you are showing "Report 11 found" are you looking for 11 or 12?

Also, what is the field type value of report_nbr? string or Integer?

Last, the BO.Seek() method will not search for the record in the database, it will look in the internal data table of the BO, so make sure the record exist in the BO so it can be found.


Edhy Rijo
(Using VB.Net 2019/SQL Server 2017)
Post #31143
Add to Twitter Add to Facebook
 Posted 4/17/2012 4:37:21 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 11/13/2014 12:18:02 AM
Posts: 6, Visits: 90
Hi Edhy,

So I have to do a fillby_reportnbr first and then the Seek?
Post #31144
Add to Twitter Add to Facebook
 Posted 4/17/2012 4:46:33 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 11/13/2014 12:18:02 AM
Posts: 6, Visits: 90
Thanks, the field is a string....But Edhy show me that the BO has to be filled before it can be used, I thought the BO look for the data directly to the table.

Thanks
Post #31145
Add to Twitter Add to Facebook
 Posted 4/17/2012 5:05:17 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 11/13/2014 12:18:02 AM
Posts: 6, Visits: 90
Hi Edhy,

Lo que me gustaria poder hacer es algo asi:

        Dim loString As String
        Dim loString2 As String

        loString = "select * from report where report_nbr = " & "'" & chkReport_nbr.Text & "'" (donde esto seria algo como "Select * from Report where Report_nbr = 'VALOR DEL COMBOBOX'"

        loString2 = "report_nbr=" & "'" & chkReport_nbr.Text & "'" & """" (donde el string seria igual pero solo con REPORT_NBR = 'VALOR DEL COMBOBOX'")

        BoReport1.FillDataTable(loString)
 

        If BoReport1.Seek(loString2) Then
           Label5.Text = BoReport1.Report_description
       Else
          MsgBox("Report not founded")
       End If

Gracias Anticipadas....
Post #31146
Add to Twitter Add to Facebook
 Posted 4/17/2012 5:09:44 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 2/14/2020 3:30:44 AM
Posts: 2,430, Visits: 23,867
Javier Porrata (4/17/2012)
... I thought the BO look for the data directly to the table.

In VFP, yes, but not in SF BO.  StrataFrame Business Objects are very well though and designed and when used properly you can do miracles.  Some of their methods are designed to manipulate their internal data table (you could compare this to a VFP table alias), so the Seek() method is one of them that will look for the first record that matches the WHERE condition, so its name may be familiar to VFP developers but in reality is not the same.

For more detail explanation, please take a look at the StrataFrame help file topic from where you got the sample code.


Edhy Rijo
(Using VB.Net 2019/SQL Server 2017)
Post #31147
Add to Twitter Add to Facebook
 Posted 4/17/2012 5:13:16 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 11/13/2014 12:18:02 AM
Posts: 6, Visits: 90
Ok Thanks Edhy,

I will do that.
Post #31148
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.