I am trying to get the result of a select query assigned to a variable but not having any luck. An extract of my code is below. I would like the result assigned to a variable maxcountall.
Dim connectDATA As ADODB.Connection
Dim rst As ADODB.Recordset
connectDATA = New ADODB.Connection
rst = New ADODB.Recordset
connectDATA.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source= ..\data\connectsmsdata.mdb;Jet OLEDB:Database Password=>one00%SmS..;")
mysql = "SELECT Max(TransAll_Query.Count)FROM TransAll_Query"
rst.Open(mysql, connectDATA)
Our community of experts have been thoroughly vetted for their expertise and industry experience.