SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist comfixit's Avatar
    Join Date
    Dec 2004
    Location
    Pasadena
    Posts
    537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with ASP/MS SQL Results

    I have a page where I

    * Open a connection to a MS SQL database
    * Create 2 record sets
    * Use the first record set to insert a value into the database
    * Immediately use the second to Select all values in the database for display

    The problem I am having is that on the first pass through when the second record set performs the query it does not show the most recent entry.

    Its as if the select statement is occuring before the insert statement. If you look in the database right after the page loads, the data is there, and the data will display on subsequent loads.

    I am having some sort of a timing issue. Does anyone have a good way to resolve the problem? Should I close the database connection after the insert and re-open a new one later in the page for the Select statement?

    Any advice is appricitated. And I apologize but the code I am working on is on my home computer so I don't have access to post it for a few hours.

  2. #2
    HardCoder md_irfan_amu's Avatar
    Join Date
    May 2005
    Location
    Asia
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its as if the select statement is occuring before the insert statement. If you look in the database right after the page loads, the data is there, and the data will display on subsequent loads.

    First insert then select statements
    or u can use the commit command after the insertion and then you get the result
    Irfan
    Find Tutors Easyway to get connect with your tutor in india


Bookmarks

Posting Permissions

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