The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

MS Access Count Issue...

Last post 04-15-2008, 11:31 AM by David.Parsons. 1 replies.
Sort Posts: Previous Next
  •  04-15-2008, 9:04 AM 8862

    MS Access Count Issue...

    I have run into an issue with MS Access that I never encountered with MySQL.  When I try to get the count of records for a data set, no value is being returned.  Below is my code for my MS Access table.  Note in the comment sections I have included what I see in my Trace output....

    The LastQuery statement works just fine in Access so I don't think that is it.  Am I missing something easy here....  Thanks for the help.....

    Code:

            Dim ad As AddressDirectory = New AddressDirectory
    
            ad.Query.es.CountAll = True
            ad.Query.es.CountAllAlias = "Count"
    
            If (ad.Query.Load()) Then
                Page.Trace.Write(additem.Query.es.LastQuery)
    ' Trace Prints >> "SELECT Count(*) AS "Count" FROM [AddressDirectory]" EsDataSourceAddressDirectory.TotalRowCount = CInt(ad.GetColumn("Count")) Page.Trace.Write("Total Count: " & ad.GetColumn("Count"))
    ' Trace prints >> "Total Count: " End If
  •  04-15-2008, 11:31 AM 8869 in reply to 8862

    Re: MS Access Count Issue...

    For Access we were using the string delimiters ("Alias") for the CountAllAlias rather than the Column delimiters ([Alias]). It produce valid syntax as your LastQuery shows, but the column name includes the double-quotes. That is being fixed in ES2008.

    Code:
    EsDataSourceAddressDirectory.TotalRowCount = CInt(ad.GetColumn("""Count"""))
    Page.Trace.Write("Total Count: " & ad.GetColumn("""Count""").ToString())

    David Neal Parsons
    www.entityspaces.net
View as RSS news feed in XML