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

    Setting Environment Variables

    This is correct... If I run my process to set the variable, then spawn a new shell it works... So it seems like it's just the broadcasting part of this process that doesn't work?
  2. Nathan Wild

    Setting Environment Variables

    Stรฉphane Wierzbicki: That post was helpful, but seems to be pretty much what I am doing? I changed my code to use SendMessageTimeOut(), which seems to make all the top level windows that I have open flash a little, but seems to leave my live environment otherwise untouched ๐Ÿ˜ž Dave Nottage: That too was very helpful, although all it really told me is that I am fighting a losing battle ๐Ÿ˜‰
  3. Nathan Wild

    TStringGrid maybe problem

    Can you post a sample project that exhibits this behaviour?
  4. Nathan Wild

    Setting Environment Variables

    This can not possibly be as complicated as it seems... I want to set an environment variable from within my application that persists after it terminates. I have tried using SetEnvironmentVariable() and then SendMessage() to broadcast the change, to no avail... I found an old post with the following function which seems like it SHOULD do what I want - but no matter what my environment is not touched. function SetGlobalEnvironment(const Name, Value: string; const User: Boolean = True): Boolean; resourcestring REG_MACHINE_LOCATION = 'System\CurrentControlSet\Control\Session Manager\Environment'; REG_USER_LOCATION = 'Environment'; begin with TRegistry.Create do try if User then { User Environment Variable } Result := OpenKey(REG_USER_LOCATION, True) else { System Environment Variable } begin RootKey := HKEY_LOCAL_MACHINE; Result := OpenKey(REG_MACHINE_LOCATION, True); end; if Result then begin WriteString(Name, Value); { Write Registry for Global Environment } { Update Current Process Environment Variable } SetEnvironmentVariable(PChar(Name), PChar(Value)); { Send Message To All Top Window for Refresh } SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, Integer(PChar('Environment'))); end; finally Free; end; end; Any help appreciated!
  5. In the RadStudio design-time object inspector some properties of some components show up highlighted, for example LiveBindings, CustomHint, PopupMenu, etc. Is there a way to define which properties show up highlighted? I don't much care about LiveBindings or CustomHint's, but I would REALLY like things like Name and Caption that I use ALL THE TIME to be easier to find in the list. I couldn't find anywhere in the OI configuration to change this. Any guidance much appreciated ๐Ÿ™‚
  6. 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!
  7. 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!
  8. What do you mean by "returning"?
  9. Sorry... I am using Pervasive.
  10. 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...
  11. 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...
  12. 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?
  13. Nathan Wild

    SQLBindParameter error with TFDQuery / ODBC

    Lovely... but where does that leave those of us who only have 10.1? ๐Ÿ˜ž
  14. 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?
  15. 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.