• Welcome, Guest. Please login.
October 25, 2021, 09:34:44 PM


Welcome to the SQLitening support forums!

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Fred Meier

Shouldn't 'rows' be 'Row' in  LISTVIEW Get Text nCbHndl, %ID_FRMUPDATESALES_LISTVIEW2, rows, Cols To m_sCustomer?
QuoteOne can use this method when the entries are static (predefined). In my case entries in the Listview could vary from one to 20 items or more. Or I'm I missing something?
Build each Insert statement into a string array and then issue the following:
   slExe join$(sArray(), "; ")
I'm not promoting this method over slExeBind, I'm just showing another way.  slExeBind will be faster.

Using slExeBind, as noted in previous post is the fastest solution, but you can also do multiple SQL Insert statements using slExe.  Just separate each statement with a semicolon.
Fixed but in slExeBind that would sometimes store invalid integer or real numbers.

This attachment only contains contains the changed modules!
There are no limits on slExeBind but there is a bug which is causing your problems. 

New modules are now available at  http://www.sqlitening.com/support/index.php?topic=3468.0
Please test and let me know.

A side benefit is that the fix also greatly improved the performance of slExeBind for integer and real numbers (no change for blob or text).
The time to insert the 3000 records in the above post when from 0.64288486 seconds to  0.14060747 seconds on my computer in local mode.
You need to have a good understanding of SQLite Data Types --- Storage Class and Column Affinity.
This is a very powerful feature of SQLite, but can be confusing.  I really like it.

Each column is assigned one of the following type affinities (TA):
Each value has one of the following storage classes (SC):

This will create column F1 as TA of Real --"Create Table T1(F1 Real)"
So even if you have TA of Real your SC can be:
   NULL if you do --  "Update T1 Set F1=NULL"
   TEXT if you do --  "Update T1 Set F1=''"
   REAL if you do --  "Update T1 Set F1='0'"

This will create column F1 as TA of None (this is my preference) --"Create Table T1(F1)"
So if you have TA of None your SC can be:
   NULL if you do --    "Update T1 Set F1=NULL"
   TEXT if you do --    "Update T1 Set F1=''"
   TEXT if you do --    "Update T1 Set F1='1.0'"
   REAL if you do --    "Update T1 Set F1=1.0"
   INTEGER if you do -- "Update T1 Set F1=1"
Check the field types for FamilyID and GenFund. They should all be Text and Real.
Use someting like this:
   slSel "Select typeof(FamilyID), typeof(GenFund) from Contributions"
   do while slGetRow
      #debug print slF(1) & "  " & slF(2)

Try the following:
Test& = Val(slSelStr("SELECT COUNT (*) From Contributions WHERE FamilyID = '100120' and GenFund <> 0"))
If it's Integer or Real then your Where value must be numeric.  SQLiteExpert does "stuff" for you so it is not always the best for finding bugs in your code.

I do see a possible bug in the DoRequest rut. If an error occurs the mutex is not being released.  I have added a ReleaseMutex as follows:

   ReleaseMutex thMutex
   function = %SQLitening_SendOrReceiveError

WaitForSingleObject will always return without waiting if the mutex is closed with CloseHandle, setting it to zero is not required.

I don't have a problem disconnecting and then re-connecting, what error are you receiving?

No limits on slExeBind nor on Join$.   Check that your array is being created correctly.
If Ajax can call a standard Dll then use the Univerals API.  Maybe there are some users with Ajax experience that can help.
Glad you solved it.  I will still do some testing, when I return, to determine what you can do or not do inside a Sel loop.
I will try to help upon my return from current trip in approx 10 days.
I see no reason why it does not work, I'm on a trip away from my computer,  will do some testing when I return in couple weeks and let you know.