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. What do you mean by "returning"?
  2. Sorry... I am using Pervasive.
  3. 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...
  4. 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...
  5. 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?
  6. Nathan Wild

    SQLBindParameter error with TFDQuery / ODBC

    Lovely... but where does that leave those of us who only have 10.1? 😞
  7. 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?
  8. 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.
  9. Nathan Wild

    Strange thing in System.Generics.Defaults.pas

    That made my day 🙂
  10. 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!
  11. 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.
  12. 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()?
  13. 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?!
  14. This is something I struggle with a lot and there has to be an easier way?! I have many projects that have both debug and release configs for win32 and/or win64 targets. Is there a simple way to have the version information THE SAME across all of these? There config options for all builds, all targets, and all configurations, but no matter what I do they all appear to be maintained separately?! All I want it to be able to set my version info in the Project | Options | Version Info | All Configurations section, and have it JUST WORK...