[Gambas-user] Starnge with DB and IF

Dag-Jarle Johansen dag.jarle.johansen at ...626...
Sun Sep 25 02:50:11 CEST 2011


Hi,
off course I have tried directly too, that works, so it seems I get
something weird from the DB.

I wrote those lines here, so I think my syntax is right in the app. I have
written DB-apps since 25 years, so I am pretty clear over how to handle
that. What is really strange to me:

S=RS!objname (With Print both show data)
IF S="Header" then
  STOP
ENDIF

is ignored. I will have to check the data and the structure, I think.


Thank you and
regards
Dag-Jarle


2011/9/24 Caveat <Gambas at ...1950...>

> In your SQL statement, it looks like there's a single quote missing
> between LC= and m.LC (at the end of the line you specifically add a
> single quote after the content of m.LC).
>
> For the rest I don't have much clue what you're going on about.  I wish
> you'd state clearly what it is you're trying to achieve.  I'm guessing
> you're trying to set the title of the Form depending on what you get out
> of the database?  Just a thought, but have you tried a Me.Refresh after
> setting the Form title?
>
> If you're having trouble setting the Form title, then you should forget
> all the database nonsense for a minute and try something as simple as
> Me.Caption = "Aanmelden"... does that work?  If not, it's nothing to do
> with your ResultSet, your database, or any IF clause... it has to be
> something else...
>
> Kind regards,
> Caveat
>
> On Sat, 2011-09-24 at 21:00 -0300, Dag-Jarle Johansen wrote:
> > Well, here I am again, almost ashamed.
> >
> > I shorten the source to the main thing:
> >
> > Public sub ReafDB()
> >
> > Dim RS as result
> > DIM S As string
> >
> > SQL="Select * From APCtrl Where Pseudo='J' AND LC=" & m.LC & "'"
> > RS=msql.$ConU.Exec(SQL)
> > RS.Movefirst
> > (There is exactly on Record present, and with print RS!objname and Print
> > RS!CtrlInhalt I can see the result, even so with S and S2)
> > Now the strange:
> > S=RS!objname
> > IF S="Header" then
> >    S2=RS!CtrlInhalt
> > ENDIF
> > Me.Caption=S2
> > END
> > S="Header", definitly
> > S2="Anmelden", evenso
> >
> > (I used S and S2 to check the content of the data)
> >
> > I get the caption "Budget", which is the name of the project. The
> programm
> > ignores the IF at all, and I also tried without if, just Me.Caption=S2 -
> is
> > ignored, simply.
> >
> > I will be grateful for any help here, the work is blocked now.
> >
> > Regards
> > Dag-Jarle
> >
> ------------------------------------------------------------------------------
> > All of the data generated in your IT infrastructure is seriously
> valuable.
> > Why? It contains a definitive record of application performance, security
> > threats, fraudulent activity, and more. Splunk takes this data and makes
> > sense of it. IT sense. And common sense.
> > http://p.sf.net/sfu/splunk-d2dcopy2
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2dcopy2
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list