cmd.ClearParameter for SQLite.dll

Discussion in 'Basic4ppc Wishlist' started by berndgoedecke, May 6, 2009.

  1. berndgoedecke

    berndgoedecke Active Member Licensed User

    Hello Erel,
    since I have tested the new SQLite.dll, my wish is a new command for the DLL.
    It's name should be ClearParameter or something like that.
    The background for this wish is the different way for handling DATE- or TIME- values in SQLIte v3.6.3 and in the moment I have no other solution to show SQL-DateTime in a ListView(ControlsExDevice) or Combo-field by using a table, filled with values by the SetParameter command:
    If I added a parameter and used it at the first time and set no value to it, because there was no value, SQLite accepted the resulted NULL value and did show a blank field.
    If I used this parameter before, for a valid DateTime value, and the next Row had no entry in the same column, the Date from the previous row was shown in the field.
    Using of "null" or "" for a column with a DateTime-Value results in an errror:
    "No valid DateTime value."
    If there is a way to set the Parameter to NULL or to clear it, would this be very nice, because it will solve another problem in the program.


    best regards

  2. Erel

    Erel Administrator Staff Member Licensed User

    If you can please post a simple program that worked with the previous version, and now doesn't work.
  3. berndgoedecke

    berndgoedecke Active Member Licensed User

    I did it.

    Hello Erel,
    I wrote a small sample, you can find attached to this post. I hope it shows the problem clearly. Please note also the remarks in th source and compare the Listview with the Textbox two times by pressing the Button two times.

    Best regards

  4. Erel

    Erel Administrator Staff Member Licensed User

    Thank you.
    The SQL library will include a cmd.SetNullParameter which will set a parameter to null value.

    If you can please download the attached library and see if it solves the problem.

    Note that I had some problems with compiling your code. There is an error on line 127 which should be: 'Case Else' instead of 'Else' and also a problem with ControlsExDesktop (maybe you are not using the latest version).

    Attached Files:

      File size:
      14.1 KB
  5. agraham

    agraham Expert Licensed User

    Probably because berndgoedecke is using ControlsExDevice on the Device and ControlsExDesktop on the desktop.

    @ berndgoedecke This won't work for optimised device compilation. ControlsExDeviceDummy (which is actually fully functional except for Notifier) should be used on the desktop for an app that is to be compiled to run on the device. ControlsExDesktop is for desktop only apps that are not intended to run on the device.
  6. Erel

    Erel Administrator Staff Member Licensed User

    Thanks for clarifying this issue.
  7. berndgoedecke

    berndgoedecke Active Member Licensed User

    It works!


    Thank you very much

    also for the hints about ControlsEx.dlls. I've mixed some components from my Desktop application(Converter to SQLite) and the Device(Data viewer for SQLite) to write the sample. Excuse my inattention please.

    My very best regards

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice