Tuesday, August 29, 2023

Create Array with key in VBA

 Cr.https://stackoverflow.com/questions/73786921/vba-collection-or-dictionary-with-an-array-and-key

Sub tettt()

Dim rsDetail

Dim sql As String

Dim myCol As Object

Dim bb

Set myCol = CreateObject("Scripting.dictionary")

Set db = CodeDb()

box1_code = "261603GF2ASERVP"

sql = "SELECT * FROM " & database_select & " where " & database_select & ".Barcode = '" & UCase(Mid(box1_code, 1, 17)) & "'"

    Set rsDetail = db.OpenRecordset(sql)

        bb = rsDetail.GetRows

    For i = 0 To rsDetail.Fields.Count - 1

        myCol.Add rsDetail.Fields(i).Name, bb(i, 0)  'first row only

    Next

    rsDetail.Close

    a = myCol("FG")

End Sub


**** case foreach

 For Each myVar In myCol.Keys     

    xxxx=myCol(myVar)

 Next myVar

Tuesday, August 8, 2023

How to built simple browser c++ QT+visual studio 2020

1 Open Visual Studio 2020

2 Add extension
    toolbar extension--> manage extension


3 select online
    and search QT

4. download QT Visual Studio tool and QT VS CMake Tool
 and wait to install. After that restart program

5 set option

 add version / select path of qmake.exe

6 open example simple browser.pro ( copy from example QT)

7 Switch to Release


8. build

9 select output ..\Release\program.exe (this does not include many .dll)
     copy to new folder


10 run command line (add support file some .dll

   C:\Qt\6.5.2\msvc2019_64\bin\windeployqt.exe -qmldir                      C:\Qt\6.5.2\msvc2019_64\qml "c:\simplebrowser\release\New folder\simplebrowser.exe"

output:
C:\simplebrowser\release\New folder\simplebrowser.exe 64 bit, release executable [QML]
Adding Qt6Svg for qsvgicon.dll
Warning: Cannot determine dependencies of C:\Qt\6.5.2\msvc2019_64\plugins\position\qtposition_nmea.dll: Unable to find dependent libraries of C:\Qt\6.5.2\msvc2019_64\bin\Qt6SerialPort.dll :Cannot open 'C:/Qt/6.5.2/msvc2019_64/bin/Qt6SerialPort.dll': The system cannot find the file specified.
Direct dependencies: Qt6Core Qt6Gui Qt6Network Qt6OpenGL Qt6Positioning Qt6PrintSupport Qt6Qml Qt6QmlModels Qt6Quick Qt6QuickWidgets Qt6WebChannel Qt6WebEngineCore Qt6WebEngineWidgets Qt6Widgets
All dependencies   : Qt6Core Qt6Gui Qt6Network Qt6OpenGL Qt6Positioning Qt6PrintSupport Qt6Qml Qt6QmlModels Qt6Quick Qt6QuickWidgets Qt6WebChannel Qt6WebEngineCore Qt6WebEngineWidgets Qt6Widgets
To be deployed     : Qt6Core Qt6Gui Qt6Network Qt6OpenGL Qt6Positioning Qt6PrintSupport Qt6Qml Qt6QmlModels Qt6Quick Qt6QuickWidgets Qt6Svg Qt6WebChannel Qt6WebEngineCore Qt6WebEngineWidgets Qt6Widgets
Warning: Cannot find Visual Studio installation directory, VCINSTALLDIR is not set.
Qt6Core.dll is up to date.
Qt6Gui.dll is up to date.
Qt6Network.dll is up to date.
Qt6OpenGL.dll is up to date.
Qt6Positioning.dll is up to date.
Qt6PrintSupport.dll is up to date.
Qt6Qml.dll is up to date.
Qt6QmlModels.dll is up to date.
Qt6Quick.dll is up to date.
Qt6QuickWidgets.dll is up to date.
Qt6Svg.dll is up to date.
Qt6WebChannel.dll is up to date.
Qt6WebEngineCore.dll is up to date.
Qt6WebEngineWidgets.dll is up to date.
Qt6Widgets.dll is up to date.
opengl32sw.dll is up to date.
D3Dcompiler_47.dll is up to date.
qtuiotouchplugin.dll is up to date.
qsvgicon.dll is up to date.
qgif.dll is up to date.
qico.dll is up to date.
qjpeg.dll is up to date.
qsvg.dll is up to date.
qnetworklistmanager.dll is up to date.
qwindows.dll is up to date.
qtposition_nmea.dll is up to date.
qtposition_positionpoll.dll is up to date.
qtposition_winrt.dll is up to date.
qmldbg_debugger.dll is up to date.
qmldbg_inspector.dll is up to date.
qmldbg_local.dll is up to date.
qmldbg_messages.dll is up to date.
qmldbg_native.dll is up to date.
qmldbg_nativedebugger.dll is up to date.
qmldbg_preview.dll is up to date.
qmldbg_profiler.dll is up to date.
qmldbg_quickprofiler.dll is up to date.
qmldbg_server.dll is up to date.
qmldbg_tcp.dll is up to date.
qwindowsvistastyle.dll is up to date.
qcertonlybackend.dll is up to date.
qopensslbackend.dll is up to date.
qschannelbackend.dll is up to date.
Creating C:\simplebrowser\release\New folder\resources...
Updating icudtl.dat.
Updating qtwebengine_devtools_resources.pak.
Updating qtwebengine_resources.pak.
Updating qtwebengine_resources_100p.pak.
Updating qtwebengine_resources_200p.pak.
Creating C:/simplebrowser/release/New folder/translations/qtwebengine_locales.
Updating am.pak.
Updating ar.pak.
Updating bg.pak.
Updating bn.pak.
Updating ca.pak.
Updating cs.pak.
Updating da.pak.
Updating de.pak.
Updating el.pak.
Updating en-GB.pak.
Updating en-US.pak.
Updating es-419.pak.
Updating es.pak.
Updating et.pak.
Updating fa.pak.
Updating fi.pak.
Updating fil.pak.
Updating fr.pak.
Updating gu.pak.
Updating he.pak.
Updating hi.pak.
Updating hr.pak.
Updating hu.pak.
Updating id.pak.
Updating it.pak.
Updating ja.pak.
Updating kn.pak.
Updating ko.pak.
Updating lt.pak.
Updating lv.pak.
Updating ml.pak.
Updating mr.pak.
Updating ms.pak.
Updating nb.pak.
Updating nl.pak.
Updating pl.pak.
Updating pt-BR.pak.
Updating pt-PT.pak.
Updating ro.pak.
Updating ru.pak.
Updating sk.pak.
Updating sl.pak.
Updating sr.pak.
Updating sv.pak.
Updating sw.pak.
Updating ta.pak.
Updating te.pak.
Updating th.pak.
Updating tr.pak.
Updating uk.pak.
Updating vi.pak.
Updating zh-CN.pak.
Updating zh-TW.pak.

C:\>
--end--

11 run simplebrowser.exe