Jump to content

Nathan Wild

  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Nathan Wild

    DBNavigator Losing Colours

    Good grief... It never even occurred to me to check and see if TDBNavigator had a StyleElement property... It is missing from the design-time inspector, so I just assumed it did not... Setting DBNavigator.StyleElements := [seFont,seBorder] had the desired effect. Thanks!
  2. Nathan Wild

    DBNavigator Losing Colours

    I am using a DBNavigator control in one of my applications and for some reason, When I place it on the form it looks fine, but as soon as I connect a datasource to it, all the buttons lose their colour. NOTE: I don't mean they are greyed-out / inactive. I mean where they used to show blue glyphs for the first, previous, next and last buttons, they now show grey ones. They work normally, and grey-out as they should depending on the state of the underlying dataset, but the difference between an enabled button and a disabled on is very hard to see without the colour! See the attached screen shot. The control on the right was just dropped onto the form, but does not have its datasource property populated. The one on the left is identical, except that it is connected to a TDataSource. This is definitely the result of a VCL theme thing, but I can't find any properties that allow me to tell this control to ignore the theme (i.e. the standard "StyleElements" property) Any guidance appreciated!
  3. What do you mean by "returning"?
  4. Sorry... I am using Pervasive.
  5. I am trying to append records to a pair of tables in a master/detail relationship. The master dataset is a writable FDQuery with an AutoInc key field. When I post to this dataset the autoinc field has a value of -1. I want to go on and write out detail records, but nothing I've tried will give me the actual value for autoinc field in the newly posted master dataset. I am not able to call FDQuery.Refesh() as it gives me a "SQLBind Parameter has not been called for parameter" error (I've posted about this before and apparently it is a known bug). FDQuery.RefreshRecord() gives me an error "[FireDAC][DApt]-400. Fetch command fetched [0] instead of [1] record. Possible reasons: update table does not have PK or row identifier, record has been changed/deleted by another user" As my master dataset is sorted by the autoinc key field, I was able to solve the issue by calling FDQuery.First() and FDQuery.Last(), but this feels wrong, so I thought I would check in and see if anyone had a suggestion for how this *SHOULD* be done? Thanks in advance...
  6. Nathan Wild

    Automatic Assignment Of NOT NULL Defaults

    Oh yes, of course... I was just hoping that there was a way to do this somewhat more automatically...
  7. I am working with a table that has a large number of fields which are ALL set up as NOT NULL. 90% of these are unused, but need to be populated when inserting new records. Is there an easy / automatic was to tell FD to automatically populate '' and 0 values as appropriate for data type when inserting new records?
  8. Nathan Wild

    SQLBindParameter error with TFDQuery / ODBC

    Lovely... but where does that leave those of us who only have 10.1? 😞
  9. Nathan Wild

    SQLBindParameter error with TFDQuery / ODBC

    So what is the best approach to do this? My end result is that I want to allow the end user to input a key value and then pass that to a a query as a parameter. This works perfectly the first time, but when I close the query, set a new parameter value and then re-open the query, I get this "SQLBindParameter has not been called for Parameter #2" error. Sure;y clearing and re-setting the entire SQL statement is not required?
  10. Is there an easy way to see EXACTLY what query FireDAC is passing through to my database server? After it does all the parameter substitutions, and automatic jiggerey pokery? I've had a few weird errors and I think being able to see this would be very helpful.
  11. Nathan Wild

    Strange thing in System.Generics.Defaults.pas

    That made my day 🙂
  12. Nathan Wild

    Detailed logging (for debugging)

    Another vote for CodeSite. I've been using a simple collection of functions that wrap it's behavior and it is an excellent, maybe even essential, tool for client-side debugging!
  13. Nathan Wild

    Solved: Application Run Check and bring to foreground

    Not sure if this helps, but the TJvAppInstances component in the JEDI VCL collection handles this quite nicely.
  14. Nathan Wild

    SQLBindParameter error with TFDQuery / ODBC

    I will try this! Any idea why it would fail with that error when I call fdquery.Refresh()?
  15. I am at a loss to explain this, but it feels like I am missing something obvious so I thought I would try here... If I have a query that does a simple select * with two parameters it works properly. If I modify the underlying table with another query, and then attempt to call .Refresh() or to activate and deactivate the select query I get a FireDAC ODBC error stating that SQLBindParameter has not been called for parameter #4. Firstly, there are only two parameters. Secondly, I don't ever call SQLBindParameter on anything. If I clear the SQL, and reset it, then reassign the parameters, it works fine? The exact error message is: [FireDAC][Phys][ODBC][Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface]SQLBindParameter has not been called for parameter #4. Sample code: fdquery.Active := FALSE; fdquery.SQL.Clear(); fdquery.SQL.Add('SELECT * FROM MyTable WHERE Key1=:KEY1 AND Key2=:KEY2;'); fdquery.ParamByName('KEY1').AsString = 'value1'; fdquery.ParamByName('KEY2').AsString = 'value2'; fdquery.Active := TRUE; // This works fine. If I then execute an "INSERT INTO MyTable" query which generates data in [MyTable], and attempt to refresh the original query. I get the above error. If I set Active := FALSE and then back to TRUE again, I get that error. The only thing that seems to work is to clear and re-add the SQL, reassign the parameters, and then reactivate it. Questions: 1) Why is this error occurring at all? 2) Why is it coming up with parameter 4 when there are only two parameters to begin with?!