troubleshooting Question

Assign SELECT query result to variable using AccessDB in VB.net ADODB

Avatar of accessloans
accessloans asked on
Visual Basic.NET
5 Comments1 Solution2378 ViewsLast Modified:
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)
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros