Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function GetNbrRes(sResource As String)
Dim sConn As String, sSQL As String
Dim rst As ADODB.Recordset, cnn As ADODB.Connection
Dim sPath As String, sDB As String
Dim sPrevCC As String, BCC As Boolean
sPath = "D:\My Documents\_Databases\_Excel"
sDB = "ResourceData"
Set cnn = New ADODB.Connection
sConn = "Provider=MSDASQL.1;"
sConn = sConn & "Persist Security Info=False;"
sConn = sConn & "Extended Properties=""DSN=Excel Files;"
sConn = sConn & "DBQ=" & sPath & "\" & sDB & ".xls;"
sConn = sConn & "DefaultDir=" & sPath & ";"
sConn = sConn & "DriverId=790;MaxBufferSize=2048;PageTimeout=5;"""
cnn.Open sConn
Set rst = New ADODB.Recordset
sSQL = "SELECT ResCC "
sSQL = sSQL & "FROM `" & sPath & "\" & sDB & "`.`ResourceData$` A "
sSQL = sSQL & "WHERE Left(ResCC,1)='5' "
sSQL = sSQL & " AND Resource Like '%" & sResource & "%' "
sSQL = sSQL & "Order By ResCC "
With rst
.Open sSQL, cnn, adOpenStatic, adLockReadOnly, adCmdText
.MoveFirst
GetNbrRes = rst(0)
.Close
End With
cnn.Close
Set rst = Nothing
Set cnn = Nothing
End Function