I am using Excel and Access 2010.
I am using the below code to get a record from an access table. How do I read what I got? It should select one record. How do I know when I didn't get any data? Thanks for the help
I am using the below code to get a record from an access table. How do I read what I got? It should select one record. How do I know when I didn't get any data? Thanks for the help
Code:
Let ProvTxt = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ThePath & Application.PathSeparator & TheFile '& ";Extended Properties=Excel 12.0 Xml;HDR=YES;"
Set cnn = New ADODB.Connection
With cnn
.Open ProvTxt
For Y = 1 To Ctr
Let SelTxt = "select * from " & WhichOne & " where 'Project ID'=" & "'" & OneRec(30, Y) & "'" & " and 'YYYYPP' = " & "'" & YYYYPP & "'"
.Execute SelTxt
Next
End With