I have the following query that correctly returns 53 rows when I run it in Access.
Select L.ID, L.TracsNumber, P.OldProjectNumber, P.ADOTPrefix, L.TestHole, L.UpperDepth, L.LowerDepth, L.SamplePhase As Phase, Format(L.DateSampled, 'mm/dd/yyyy') As Sampled, T.Description As Type, L.SampledBy From (GeoLog L Left Join Project P On P.TracsNumber = L.TracsNumber) Left Join SAMaterialType T On T.MaterialTypeCode = L.MaterialTypeCode Where P.ADOTPrefix Like '*60*' Order By L.TracsNumber, L.SamplePhase, L.TestHole, L.UpperDepth;
I am using the query in VB.Net to populate a DataTable as follows:
mdtList = New DataTable
Try
da = New OleDb.OleDbDataAdapter(strSql, gstrConnect)
da.Fill(mdtList)
After running this code, mdtList contains zero rows. strSql contains the exact same query as shown above, and I am using the same database.
Does anyone see my problem? I am used to working with SQL Server, and am wondering if this is some quirky thing with Access.
Thanks.
Select L.ID, L.TracsNumber, P.OldProjectNumber, P.ADOTPrefix, L.TestHole, L.UpperDepth, L.LowerDepth, L.SamplePhase As Phase, Format(L.DateSampled, 'mm/dd/yyyy') As Sampled, T.Description As Type, L.SampledBy From (GeoLog L Left Join Project P On P.TracsNumber = L.TracsNumber) Left Join SAMaterialType T On T.MaterialTypeCode = L.MaterialTypeCode Where P.ADOTPrefix Like '*60*' Order By L.TracsNumber, L.SamplePhase, L.TestHole, L.UpperDepth;
I am using the query in VB.Net to populate a DataTable as follows:
mdtList = New DataTable
Try
da = New OleDb.OleDbDataAdapter(strSql, gstrConnect)
da.Fill(mdtList)
After running this code, mdtList contains zero rows. strSql contains the exact same query as shown above, and I am using the same database.
Does anyone see my problem? I am used to working with SQL Server, and am wondering if this is some quirky thing with Access.
Thanks.