If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Sql returns rows but asp pg doesnt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-24-06, 12:43
csamuels csamuels is offline
Registered User
 
Join Date: Mar 2006
Location: south jersey, usa
Posts: 53
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'
Reply With Quote
  #2 (permalink)  
Old 05-24-06, 14:33
wayneph wayneph is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 05-24-06, 14:59
csamuels csamuels is offline
Registered User
 
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
__________________
"They say Moses split the Red Sea
I split the blunt and rolled the fat one, I'm deadly"
-- Tupac 'Blasphemy'

Last edited by csamuels; 05-24-06 at 15:03.
Reply With Quote
  #4 (permalink)  
Old 05-24-06, 15:05
csamuels csamuels is offline
Registered User
 
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'
Reply With Quote
  #5 (permalink)  
Old 05-24-06, 15:16
wayneph wayneph is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 05-24-06, 16:04
csamuels csamuels is offline
Registered User
 
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'
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On