JTaylor
2023-10-27T21:01:33Z
I have used iGrid for many years and it has worked fine but recently I started using it on some Virtual Machines. While not the fastest things they are quite adequate for what I am doing. The problem is that FillFromRS() is VERY slow. My script is below. It is very simple. It takes about 5-7 seconds for 50 records to load and over 2 minutes for 500. That is just the FillFromRS() function. Not the query. I have verified that part. I just spent $195 because I thought maybe 7.50.0 had issues and maybe 7.50.25 would solve the problem but turns out I wasted my money.

Any suggestions? I don't know what else to check. The only obvious difference is it is running on a Virtual Machine.

Thanks.

jim

SQLText = "SELECT * from vLRP where batchid = 120 order by ID asc;"
myRS.Open (SQLText, myConn, adoConst.adOpenStatic, adoConst.adLockReadOnly, adoConst.adCmdText)
If myRS.EOF == @FALSE
igrid.BeginUpdate
igrid.FillFromRS(myRS)
igrid.EndUpdate
EndIf
myRS.Close
Igor/10Tec
2023-10-28T09:50:14Z
The FillFromRS method should work faster. Have you tried to execute the same code not under your virtual machine?

I suspect that the problem can be in ADO executed in this virtual environment. Perhaps, it communicates with the database engine and/or query result through some additional layers that slow down code performance dramatically.
JTaylor
2023-10-29T14:42:22Z
Same Behavior. Another difference I considered was that most of my experience has been using MySQL and this uses SQL Server. Also, this database is remote rather than on the local machine but time still seems excessive for so few records. My previous process involved a web call which returned JSON, I parsed the JSON and inserted into a local database and then Opened a Recordset and populated my grid (not igrid) from an array, obtained via GetRows(), and it takes about 4 seconds for 100 records.

I can't see anything I am doing wrong. Any other suggestions?

A related question. Should iGrid load from array created by RecordSet.GetRows()? Don't think I have ever gotten that to work.

Thanks.

Jim
JTaylor
2023-10-29T16:09:56Z
Also, a slightly related question...

Do you happen to have a way to register the iGrid control without needing Admin privileges?

Was thinking it could be registered to CurrentUser but needed the registry entries. Is this possible?

Jim
Igor/10Tec
2023-10-30T08:43:18Z
If I understand your right, you have performance problems with enumerating rows in results of queries to this remote database and this does not depend on iGrid. Perhaps, you need to change the data retrieval strategy - for example, change the recordset type.

I also see from your script source code that it is not VB6 or Microsoft Office VBA. Perhaps, this non-native (not Microsoft) environment also adds a layer of communication that slows down the process. Try to execute the same code in VB6/VBA to measure its performance and compare it to what you have in your development environment.

Regarding registering iGrid without admin rights, we provide this info in the KB section for iGrid ActiveX on this forum:

https://10tec.com/forum/...rid-without-admin-rights 
JTaylor
2023-10-30T13:31:55Z
Sorry if I missed this in your reply but... Should iGrid load from array created by RecordSet.GetRows()? Don't think I have ever gotten that to work.

Jim
JTaylor
2023-10-30T13:33:52Z
I have used iGrid in this environment for 15+ years, and have been very happy up to this point, so reasonably sure my environment isn't the issue.

Any recommended "recordset types" to try?

Jim
JTaylor
2023-10-30T13:48:58Z
Using adOpenForwardOnly, which in this situation should be fine, solved the problem. Thank you.

Jim
Igor/10Tec
2023-10-31T15:44:47Z
Recordset.GetRows() return an array but not a recordset. As such, it cannot be used with the FillFromRS() method. You could try to 'feed' it to the LoadFromArray() method of iGrid.
JTaylor
2023-10-31T16:04:24Z
Sorry if my question wasn't clear but that is what I meant...using LoadFromArray(). That has always failed for me.

jim
Igor/10Tec
2023-11-01T05:54:36Z
It would be nice to see a sample to investigate your problem with LoadFromArray. But taking into account your development environment and remote database, I think it's not possible.

But if you already solved the problem with performance, most likely, there is no need to work on the problem with LoadFromArray.
JTaylor
2023-11-01T13:55:39Z
I think it is a case of needing to read more closely. I am guessing the issue is that I thought the array would populate the grid in a similar fashion as FillFromRS(), in that it would create the needed rows and columns. I see now that is not the case.

Sorry to have wasted your time.

Jim