Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2006
    Location
    south jersey, usa
    Posts
    53

    Unanswered: Sql returns rows but asp pg doesnt

    Code:
    set conn = CreateObject("ADODB.Connection")
    set sqlconn = CreateObject("ADODB.Connection")
    set rs = CreateObject("ADODB.Recordset")
    
    set conn = CreateObject("ADODB.Connection") 'prep connection'
    conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=" & sqlserver & ";UID=" & sqluser &_
                 ";PWD=" & sqlpwd & ";DATABASE=" & sqldb
    
    ...
    
      query = "Select pluw, plua from agents where code = " & agentcode
      rs.open query, conn
      response.write query & "<BR>" 
      'response.write rs.fields("pluw") & " - " & rs.fields("plua") & "<BR>"
      if rs.eof then
        response.write "<font color=red><b>Agent Code not found</b></font><br><br>"

    I'm connecting to SQL and running a query to return user initials for the specified code. Code is my primary key for the table. There are no other indexes or keys on the table.

    The data I had in the table prior to creating the asp page is returned when entering its code. But if a new record is created, the asp page returns nothing and displays agent code not found. But i can copy the query generated by the asp page and have query analyzer return the record.

    why cant I retrieve new records from sql using the asp page?
    "They say Moses split the Red Sea
    I split the blunt and rolled the fat one, I'm deadly"
    -- Tupac 'Blasphemy'

  2. #2
    Join Date
    Aug 2005
    Location
    D/FW, Texas, USA
    Posts
    78
    1. Have you verified that the server/database parameters in your connection string are pointing to the same database you're pointing to with QA?
    2. Have you cleared the Cache (Temporary Internet Files) in the browser to make sure you're not just seeing an old copy of the page?
    --wayne
    SELECT * FROM Users WHERE Clue>0
    0 rows returned

  3. #3
    Join Date
    Mar 2006
    Location
    south jersey, usa
    Posts
    53
    1. i can successfully query data that was in the table before the asp page was created.

    2. i'll try then edit this post --> same result after clearing tmp inet cache
    Last edited by csamuels; 05-24-06 at 16:03.
    "They say Moses split the Red Sea
    I split the blunt and rolled the fat one, I'm deadly"
    -- Tupac 'Blasphemy'

  4. #4
    Join Date
    Mar 2006
    Location
    south jersey, usa
    Posts
    53
    **old data


    **new data


    **new data queried from sql
    "They say Moses split the Red Sea
    I split the blunt and rolled the fat one, I'm deadly"
    -- Tupac 'Blasphemy'

  5. #5
    Join Date
    Aug 2005
    Location
    D/FW, Texas, USA
    Posts
    78
    Normally when I run into issues like this, I have my app pointing at a test database or something like that instead of production.

    From the pieces you've shown us here, it looks like it should be working.
    --wayne
    SELECT * FROM Users WHERE Clue>0
    0 rows returned

  6. #6
    Join Date
    Mar 2006
    Location
    south jersey, usa
    Posts
    53
    right on the money. i was connecting to a test db instead of live.
    "They say Moses split the Red Sea
    I split the blunt and rolled the fat one, I'm deadly"
    -- Tupac 'Blasphemy'

Posting Permissions

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