Results 1 to 5 of 5

Thread: dbRecordCount

  1. #1
    Larry Guest

    dbRecordCount

    Hello. I am trying to make a grid with the number of records in it displayed before the grid is displayed. If I place my dbRecordCount statement before the X.ASPdbPro statement, the record count is displayed before the table, but the initial count is not displayed upon initial loading of page, and will only be displayed if reload is pressed on the browser.

    If I put this statement after X.ASPdbPro statement, the record count is updated with first load of page, but displayed after table.

    Any idea on how to display the record count before the table, but get it to display on first load of page? Thanks in advance!

    Larry
    lf@lwpes.org

  2. #2
    John Guest

    dbRecordCount (reply)

    Hi Larry,

    It's a "cart before the horse" thing! Only AFTER your call to ASPdb (x.ASPdbPro in your case) is the x.dbRecordCount value calculated. This is because this is when the records are read and displayed, and this variable is set.

    The only way around your problem is to make TWO calls to ASPdb. You can set x.dbDisplay=False (turns off all output), then do the call to ASPdb. Now x.dbRecordCount is set and you can Response.Write it.

    Next set x.dbDisplay=True and do another call to ASPdb and display your data.

    That's the only way. Oh, by the way, you can speed things up by making that first call as SIMPLE and clean as possible. For example only select ONE field, and don't do any ORDER BY or anything. Just the basics to get the record count right. Also be sure dbMode="grid" as modes like "dual" cause two grids to be built, etc.

    Hope this helps!

    John

    ------------
    Larry at 10/9/01 9:49:40 PM

    Hello. I am trying to make a grid with the number of records in it displayed before the grid is displayed. If I place my dbRecordCount statement before the X.ASPdbPro statement, the record count is displayed before the table, but the initial count is not displayed upon initial loading of page, and will only be displayed if reload is pressed on the browser.

    If I put this statement after X.ASPdbPro statement, the record count is updated with first load of page, but displayed after table.

    Any idea on how to display the record count before the table, but get it to display on first load of page? Thanks in advance!

    Larry
    lf@lwpes.org

  3. #3
    Larry Guest

    dbRecordCount (reply)

    Thanks for the help! One comment/question... I believe that the X.dbRecordCount actually counts the records that meet your search criteria in your SELECT statement, not the total number of records in the table (please correct me if I am wrong). If I use a simple SELECT statement that uses different criteria, the number of records counted in X.dbRecordCount will be different than in the table I actually want displayed. Right?

    Larry


    ------------
    John at 10/9/01 10:59:24 PM

    Hi Larry,

    It's a "cart before the horse" thing! Only AFTER your call to ASPdb (x.ASPdbPro in your case) is the x.dbRecordCount value calculated. This is because this is when the records are read and displayed, and this variable is set.

    The only way around your problem is to make TWO calls to ASPdb. You can set x.dbDisplay=False (turns off all output), then do the call to ASPdb. Now x.dbRecordCount is set and you can Response.Write it.

    Next set x.dbDisplay=True and do another call to ASPdb and display your data.

    That's the only way. Oh, by the way, you can speed things up by making that first call as SIMPLE and clean as possible. For example only select ONE field, and don't do any ORDER BY or anything. Just the basics to get the record count right. Also be sure dbMode="grid" as modes like "dual" cause two grids to be built, etc.

    Hope this helps!

    John

    ------------
    Larry at 10/9/01 9:49:40 PM

    Hello. I am trying to make a grid with the number of records in it displayed before the grid is displayed. If I place my dbRecordCount statement before the X.ASPdbPro statement, the record count is displayed before the table, but the initial count is not displayed upon initial loading of page, and will only be displayed if reload is pressed on the browser.

    If I put this statement after X.ASPdbPro statement, the record count is updated with first load of page, but displayed after table.

    Any idea on how to display the record count before the table, but get it to display on first load of page? Thanks in advance!

    Larry
    lf@lwpes.org

  4. #4
    Larry Guest

    dbRecordCount (reply)

    John - I tried what you suggested, but it did not work. Nothing at all was displayed when the page was loaded. I am sure I coded it wrong somehow. Here is what I have entered:

    Set X = Server.CreateObject("AspDB.Pro&#34
    X.dbMDB = Server.MapPath("database.mdb&#34
    .
    .
    .
    X.dbDisplay=False
    X.dbSQL="Select * FROM Positions Where DateUpdated > #4/8/2001# And Filled=0"
    X.ASPdbPro
    X.dbDisplay=True

    rc = X.dbRecordCount
    response.write("There are currently " & rc & " positions listed.&#34

    X.dbSQL="Select * FROM Positions Where DateUpdated > #4/8/2001# And Filled=0 Order by State" '
    .
    .
    .
    X.ASPdbPro

    It worked well until I added the 4 lines starting with X.dbDisplay=False. When you look at the page source for the web page after it is supposed to load, here is what is stated:

    error '800a01b6
    Object doesn't support this property or method: 'dbDisplay'

    It sounds like the dbDisplay code is not valid.
    Thanks again!

    Larry
    lf@lwpes.org


    ------------
    John at 10/9/01 10:59:24 PM

    Hi Larry,

    It's a "cart before the horse" thing! Only AFTER your call to ASPdb (x.ASPdbPro in your case) is the x.dbRecordCount value calculated. This is because this is when the records are read and displayed, and this variable is set.

    The only way around your problem is to make TWO calls to ASPdb. You can set x.dbDisplay=False (turns off all output), then do the call to ASPdb. Now x.dbRecordCount is set and you can Response.Write it.

    Next set x.dbDisplay=True and do another call to ASPdb and display your data.

    That's the only way. Oh, by the way, you can speed things up by making that first call as SIMPLE and clean as possible. For example only select ONE field, and don't do any ORDER BY or anything. Just the basics to get the record count right. Also be sure dbMode="grid" as modes like "dual" cause two grids to be built, etc.

    Hope this helps!

    John

    ------------
    Larry at 10/9/01 9:49:40 PM

    Hello. I am trying to make a grid with the number of records in it displayed before the grid is displayed. If I place my dbRecordCount statement before the X.ASPdbPro statement, the record count is displayed before the table, but the initial count is not displayed upon initial loading of page, and will only be displayed if reload is pressed on the browser.

    If I put this statement after X.ASPdbPro statement, the record count is updated with first load of page, but displayed after table.

    Any idea on how to display the record count before the table, but get it to display on first load of page? Thanks in advance!

    Larry
    lf@lwpes.org

  5. #5
    John Guest

    dbRecordCount (reply)

    Hi Larry,

    My you're old! ;-) The version of your software is probably two years old (or more) and doesn't have that property (dbDisplay). That's why it didn't work. Have you thought about upgrading to the current version? It adds that property along with lots of others and numerous fixes.

    Go to: www.aspdb.com and click on the NEWS and PATCHES links at the top to see what has changed - there's a LOT out there.

    There may be a way to work around the display limitation by turning off each piece of data that's being output (headers, data, statusbar, buttons, etc), but the upgrade would be the better way to go.

    Contact me for more information at john@majormicro.com.

    Thanks!
    John




    ------------
    Larry at 10/10/01 11:08:37 PM

    John - I tried what you suggested, but it did not work. Nothing at all was displayed when the page was loaded. I am sure I coded it wrong somehow. Here is what I have entered:

    Set X = Server.CreateObject("AspDB.Pro&#34
    X.dbMDB = Server.MapPath("database.mdb&#34
    .
    .
    .
    X.dbDisplay=False
    X.dbSQL="Select * FROM Positions Where DateUpdated > #4/8/2001# And Filled=0"
    X.ASPdbPro
    X.dbDisplay=True

    rc = X.dbRecordCount
    response.write("There are currently " & rc & " positions listed.&#34

    X.dbSQL="Select * FROM Positions Where DateUpdated > #4/8/2001# And Filled=0 Order by State" '
    .
    .
    .
    X.ASPdbPro

    It worked well until I added the 4 lines starting with X.dbDisplay=False. When you look at the page source for the web page after it is supposed to load, here is what is stated:

    error '800a01b6
    Object doesn't support this property or method: 'dbDisplay'

    It sounds like the dbDisplay code is not valid.
    Thanks again!

    Larry
    lf@lwpes.org


    ------------
    John at 10/9/01 10:59:24 PM

    Hi Larry,

    It's a "cart before the horse" thing! Only AFTER your call to ASPdb (x.ASPdbPro in your case) is the x.dbRecordCount value calculated. This is because this is when the records are read and displayed, and this variable is set.

    The only way around your problem is to make TWO calls to ASPdb. You can set x.dbDisplay=False (turns off all output), then do the call to ASPdb. Now x.dbRecordCount is set and you can Response.Write it.

    Next set x.dbDisplay=True and do another call to ASPdb and display your data.

    That's the only way. Oh, by the way, you can speed things up by making that first call as SIMPLE and clean as possible. For example only select ONE field, and don't do any ORDER BY or anything. Just the basics to get the record count right. Also be sure dbMode="grid" as modes like "dual" cause two grids to be built, etc.

    Hope this helps!

    John

    ------------
    Larry at 10/9/01 9:49:40 PM

    Hello. I am trying to make a grid with the number of records in it displayed before the grid is displayed. If I place my dbRecordCount statement before the X.ASPdbPro statement, the record count is displayed before the table, but the initial count is not displayed upon initial loading of page, and will only be displayed if reload is pressed on the browser.

    If I put this statement after X.ASPdbPro statement, the record count is updated with first load of page, but displayed after table.

    Any idea on how to display the record count before the table, but get it to display on first load of page? Thanks in advance!

    Larry
    lf@lwpes.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •