This topic is locked
[SOLVED]

  After modifying linked view on MySQL server fields does

6/29/2011 7:35:20 AM
PHPRunner General questions
J
jevobz author

There's a problem with PhpRunner v. 5.3 build 7474:
I have server-side view on MySQL server (5.1), link it to PhpRunner - everything is fine. Of course in query tab there's a message that "unable to parse SQL query" ( like described in http://www.asprunner.com/forums/topic/14873-phprunner-was-unable-to-parse-your-sql-query/ ) - but I don't treat it as big problem.
A problem is, if I modify that view on server (let's say add a field or remove one), then synchronize database, fields in "Choose fields" page DOES NOT update; SQL text reflects changes when "Reset query" is pressed but new statement won't be saved in project.
That's very frustrating experience, because to get new field in "Choose Fields" page I have to remove view from project and re-include it, and all custom pages, labels and field formats are lost. The easiest solution IMHO would be interpretation of MySQL's view as simple read-only table, like MS Access does.

Sergey Kornilov admin 6/29/2011

Make sure you synchronized your project after modifying MySQL database. This can be done on 'Datasource tables' screen in PHPRunner.

J
jevobz author 6/29/2011



Make sure you synchronized your project after modifying MySQL database. This can be done on 'Datasource tables' screen in PHPRunner.


If you mean "synchronize" by executing right-click Sync Database command then I'm sure.

Updated structure of view is shown on Tables grid, correct results in the output window are returned BUT no changes are reflected in SQL definition (after pressing Reset query it changes, but does not saves to the project) and Fields tab (I've just deleted a column in view definition on my server, but in Fields tab that columns still shows).
I think there's an old bug - link to old post I've provided describes the same thing, but with different (MS SQL) SQL server

Sergey Kornilov admin 6/30/2011

If you use a custom SQL Query - you need to modify it manually after synchronization. If this doesn't help contact support directly sending your project file and database for investigation.

J
jevobz author 6/30/2011

No, I haven't made any customizations in PHPRunner. It simply ignores any subsequent (after first link) change of linked server-side MySQL view - that's what I wanted to say, and synchronization does not help. In case of contact with support, what should be sent - database dump, alter view SQL file and phpr file?

J
jevobz author 7/1/2011

Well, I've just found a solution - if somebody will face the same problem, it is possible to manually edit phpr project file, which is in fact XML file. We need to search there for SQL definitions and fix them (there are 2 inside tags <m_strSQL> and <m_sqlHead>), then for label (inside tag <m_arrFieldLabels>) and add it (by copying and changing other label) and finally for big <m_arrFieldObj> section where Runner's fields definitions are located. I've just copied definition of the same type, placed it in query's order and renamed it. I found these tags by searching for view's name. At the first sight, it works.
Of course, I don't guarantee anything, use at your own risk. Make a backup first.

But I think manual edition sometimes pays off, if we don't want to lose custom pages and bound events.

Sergey Kornilov admin 7/1/2011

Cannot comment on this. Need to see project and database in order to provide a meaningful response.

J
jevobz author 7/8/2011

Well, I finally figured out root cause of the problem. My MySQL user had no "SHOW VIEW" privilege (another clients like Access don't require that privilege, they simply use view as table). After adding it, query parser started to work.

So there's no need in hacking phpr file <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=59315&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />