Search:

Type: Posts; User: jpbro

Page 1 of 13 1 2 3 4

Search: Search took 0.19 seconds.

  1. Re: The 1001 questions about vbRichClient5 (2020-07-21)

    You haven't created an instead of the cFSO object yet. Try:



    New_c.FSO.FileExists(App.Path & "\Logo.png")
  2. Re: Sqlite how to check if a field is empty?

    Try IsEmpty(Rs(FieldName))
  3. Re: [RESOLVED] Need help from Schmidt or other experts

    You can use an IIF function in your SQL statement to test if the string starts with "le:". If so, we will slurp the date information from one position (starting from character 4), if not then we will...
  4. Re: Need help from Schmidt or other experts

    Looks like you are one character off on your SUBSTR offsets. Maybe there are two spaces between "Le:" and the date in the medicament field?

    Try adding one to the first numeric parameter of each...
  5. Re: Need help from Schmidt or other experts

    Duh! Good catch, thanks Wolfgang.
  6. Re: Need help from Schmidt or other experts

    Mustaphi -

    SUBSTR in SQLite queries is like Mid$ in VB6 code. SUBSTR documention is here: https://sqlite.org/lang_corefunc.html#substr

    So, SUBSTR('ABCDE', 2, 3) would return 'BCD' in SQLite,...
  7. Re: Need help from Schmidt or other experts

    Is the date you want always in the same position and the same format in the "Medicament" field? If so, SUBSTR should do the trick. For example:



    Option Explicit

    Sub Test()
    Dim c As...
  8. Replies
    22
    Views
    1,126

    Re: [RESOLVED] Advise on Function's Intent

    Yes, I'd go with Replace$ if speed isn't absolutely critical. About ~1.5x faster than the original function, and infinitely more readable. If speed is critical, then the SafeArray approach is...
  9. Replies
    22
    Views
    1,126

    Re: [RESOLVED] Advise on Function's Intent

    Below is an even faster version (55-60x faster than the original function!) if you don't mind using APIs:



    Option Explicit

    Private Const FADF_AUTO As Integer = &H1 'An array that is...
  10. Replies
    22
    Views
    1,126

    Re: [RESOLVED] Advise on Function's Intent

    If you're going to be calling this function a lot and the goal is to strip " " and "-" characters from any string, then the following code when compiled with optimizations enabled is about 5x faster...
  11. Replies
    22
    Views
    1,126

    Re: [RESOLVED] Advise on Function's Intent

    There is a bit of a puzzle in terms of the code's intent that can maybe only be answered by looking at the larger application. What data is typically being passed to FormatField?

    First, the code...
  12. Replies
    22
    Views
    1,126

    Re: Advise on Function's Intent

    I think you are missing something - looks like it is removing all " " and "-" characters from the string, so:



    Function FormatField(ByVal RawField As String) As String
    FormatField =...
  13. Re: Having multiple memory databases using vbRichClient5 Sqlite

    Whenever you see New_c you can *almost completely* mentally substitute the regular VB6 New keyword, but with some differences:

    - New_c doesn't require a trip to the registry or SxS to instantiate...
  14. Re: VBRichClient5 cCollection ItemExists Question

    The bug is due to a logic error in the string comparison code of the .ItemExists method. It returns True whenever an item that *doesn't* match the passed value is found, instead of returning True...
  15. Re: VBRichClient5 cCollection ItemExists Question

    Looks like a bug. I've found the source of the problem and I will report it to Olaf, thanks for posting the question and test code!
  16. Re: Questions about adding a new collation using vbRichClient5

    For Q2:



    Option Explicit

    Private Sub Command1_Click()
    Dim lo_Cnn As vbRichClient5.cConnection
    Dim lo_Cnn2 As vbRichClient5.cConnection
  17. Re: Questions about adding a new collation using vbRichClient5

    Here's a test you can try for Q1:



    Option Explicit

    Private Sub Command1_Click()
    Dim ii As Long
    Dim lo_Cnn As vbRichClient5.cConnection
  18. Replies
    1,646
    Views
    78,898

    Re: Corona virus, China major city lockdowns, etc.

    test
  19. Thread: Read a JSON file

    by jpbro
    Replies
    5
    Views
    425

    Re: Read a JSON file

    Daniel - correct me if I'm wrong, but I thought you were using RC5? If so it can serialize/deserialize JSON to/from cCollection classes using New_C.JSONDecodeToCollection or...
  20. Replies
    18
    Views
    1,091

    Re: Shutting Down VB 6.0

    ??

    177850
  21. Replies
    5
    Views
    586

    Re: Help with Window Functions (SQLite 3.28)

    Hi Chris - sorry for taking so long to get back to you on this, and thank you for all your help.

    I've temporarily given up on using Window functions, as I just couldn't get them to work. Not a...
  22. Replies
    11
    Views
    749

    Re: sqlite: Database seems to be corrupted

    I'm afraid it's really bad news if you don't have a backup. Unless Google is mangling the DB at the link you sent me, it clearly looks like Google HTML code for their login page:

    Result in...
  23. Replies
    11
    Views
    749

    Re: sqlite: Database seems to be corrupted

    I took a look at the file you sent - it appears to be an HTML document, not an SQLite database. When I open it up, it looks like a Google login page.

    Just a hunch: does your app grab your...
  24. Replies
    11
    Views
    749

    Re: sqlite: Database seems to be corrupted

    Also - were you using a password for the database, and if so - are you sure you are still using the same password to open it?
  25. Replies
    11
    Views
    749

    Re: sqlite: Database seems to be corrupted

    Can you post the database file, or does it contain private information?
  26. Replies
    5
    Views
    586

    Re: Help with Window Functions (SQLite 3.28)

    Hi Chris, thank you for the response.

    I like the idea of creating an integer only sort idea - I imagine it would improve performance so I'll give it a try against my old/slow SQL, but it's not...
  27. Replies
    5
    Views
    586

    Re: Help with Window Functions (SQLite 3.28)

    Apologies - I made a mistake with my requirements for #3 and #4, so if you read those requirements please note that they have changed.
  28. Replies
    5
    Views
    586

    Help with Window Functions (SQLite 3.28)

    For some background - I've been wanting to learn how to use SQLite's new-ish Window Functions feature, and I have finally gotten around to it with a real-world candidate statement to work and compare...
  29. Replies
    5
    Views
    478

    Re: DELETE the last carriage return

    LOL - Yikes! I guess that's what happens when you don't get a full night's sleep for almost 4 months. Thanks for the correction.
  30. Replies
    5
    Views
    478

    Re: DELETE the last carriage return

    Lots of ways to skin this cat.

    1. Append your CRLF characters *after* RS.MoveNext, and only if Not RS.EOF.

    2. Trim the last CRLF *after* the loop using Left$(TESTO, Len(TESTO) - 2)

    3. If...
  31. Replies
    4
    Views
    443

    Re: VB6 activeX exe on Wine

    You can register an ActiveX EXE by executing it with the /regserver parameter. E.g.:



    yourexeName.exe /regserver
  32. Replies
    17
    Views
    1,375

    Re: Redesign of Resource Editor - Suggestions

    I understand not wanting to roll your own icon/bitmap editing feature, but how about allowing users to shell out to an external editor for each file type and automatically replacing the resource when...
  33. Replies
    4
    Views
    428

    Re: Access Vs Sqlite

    10 seconds is surprising, but your code does have some inefficiencies. How about using a Command object wrapped by a transaction?

    NOTE: I haven't tested the code below, so please run it against a...
  34. Replies
    31
    Views
    1,065

    Re: Date values as const?

    Does not compute.
  35. Replies
    6
    Views
    422

    Re: Form Icon and X button

    Setting the ControlBox property to False removes the Icon, but also removes the X/Close button instead of disabling it. Maybe that's close enough for your needs?
  36. Re: PropertyBag vs Collection (and what's the internal structure of a PropertyBag?)

    Yikes, that PropertyBag Add time is ugly, but the Read time is impressive. Quite a difference!

    For those of you that don't mind using a third-party library, the RC5 cCollection performs nicely:
    ...
  37. Replies
    38
    Views
    1,435

    Re: vbWidgets/RC5 UI Questions "Megathread"

    26. There's a small bug in the way RC5 widgets handles focused buttons with the Default property = True.

    When a cwButton has focus and its Default property = True, pressing the Enter key once...
  38. Replies
    38
    Views
    1,435

    Re: vbWidgets/RC5 UI Questions "Megathread"

    Thanks for the example - I was indeed doing the operations against the underlying cRecordset, but I was calling rs.Delete in a loop instead of collection IDs and then using an SQL DELETE to clear...
  39. Replies
    38
    Views
    1,435

    Re: vbWidgets/RC5 UI Questions "Megathread"

    25. This is more of a note to self/other newcomers than a question/issue. If you let Widget.LockRefresh = True and Widget.Enabled = False, you must subsequently let Widget.Enabled = True,...
  40. Replies
    38
    Views
    1,435

    Re: vbWidgets/RC5 UI Questions "Megathread"

    24. Sorry, another cwGrid/cwVList question. This one is related to performance. When I'm performing lots of deletes on an underlying RS datasource and setting the related Selected(index) property to...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width