NetTalk Central

Author Topic: [SOLVED]Browse behaviour using MySQL  (Read 5624 times)

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
[SOLVED]Browse behaviour using MySQL
« on: August 26, 2014, 01:26:59 PM »
Hi,

I have a Browse (wizzard generated) on a MySQL table.
There are more than 700 rows in the table.
When I open the browse from the menu, only the first record is shown.
When I click the menu again to open/refresh the browse it opens okay.
Using the locator (contains) is also not without problems.
Only one result line is shown, even though there are known more results.
Resetting the locator does not work as smoothly as with TPS.
Anyone having the same problems?

Cheers,
Rene
« Last Edit: September 08, 2014, 08:23:04 PM by Rene Simons »
Rene Simons
NT14.14

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: Browse behaviour using MySQL
« Reply #1 on: August 27, 2014, 11:33:50 PM »
Hi Rene,

I have problems with MySQL tables if I don't specify a truly unique index in the Browse procedure.  Sometimes I've tried using a non unique index and get some crazy things happening, so always have to resort to a unique primary index in the properties screen and do my other sorting under the 'Sort' tab.

Cheers,
Devan

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Browse behaviour using MySQL
« Reply #2 on: August 28, 2014, 10:38:25 AM »
Hello Devan,

Thanks for your input.
As I am working with NTWS, I know I must have a Primary Unique key in all tables.
After I read your message I did a check on the keys. And they are all as required.
Also in the browse I have selected this key for the Unique key.

So I'll try ODBC example 26 of FM3 and see what else I can do.
I'll report back as soon as I have made any progress.

Cheers,
Rene
Rene Simons
NT14.14

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Browse behaviour using MySQL
« Reply #3 on: August 29, 2014, 03:15:36 PM »
I had a weird error after updating a record where the parent browse would not properly refresh. I tried everything, until I finally traced it down to a view error in the browse SetView. My work around (see code below) was to add a manual next as soon as the view was opened. If I got an error 78 (which was because of an unknown problem), I closed the view, then reopened it with the same settings as per the template code just before that embed point. If there was no error, I issued a Previous(View) to restore the correct starting point for the display.

  ! Start of "After SetView"
  ! [Priority 5000]
  Next(ThisView)
  CASE ErrorCode()
  OF 78 ! Invalid number of parameters error appears for unknown reason
    IF p_web.GetSessionLevel() = 1 and FileErrorCode()
      stop('fileerror='&Clip(FileError())&' fileerrorcode='&fileerrorcode())
    END
    Close(ThisView)

Good luck,

Mark
    Open(ThisView)
    ThisView{prop:Filter} = loc:FilterWas
     p_web.SetView(ThisView,InvoiceCustomerSQL,INC:KeyInvoiceCustomerID,loc:PageRows,'BrowseInvoice',left(Loc:LocateOnFields),left(Loc:LocateField),loc:FileLoading,loc:LocatorType,clip(loc:LocatorValue),Loc:SortDirection,loc:ViewOptions,Loc:FillBack,Loc:Direction,loc:NextDisabled,loc:PreviousDisabled,Loc:LocatorCase,loc:RandomBrowseId)
  ELSE
    Previous(ThisView)
  END

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Browse behaviour using MySQL
« Reply #4 on: August 29, 2014, 10:55:04 PM »
Hi Mark,

I'll see if this works for me to. Thanks a lot for the tip.
Maybe this is something for bruce to look into as well?

Rene
Rene Simons
NT14.14

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Browse behaviour using MySQL
« Reply #5 on: September 04, 2014, 12:10:17 PM »
Hi,
I am still having problems with the MySql .
Has anyone build an app using MySql without having problems?
Thanks,
René
Rene Simons
NT14.14

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
[SOLVED]Browse behaviour using MySQL
« Reply #6 on: September 08, 2014, 08:25:21 PM »
Hi,
After installing and using MySQL ODBC 5.3.4 my troubles are over.
Thanks,
René
Rene Simons
NT14.14