472,125 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,125 software developers and data experts.

ASP Help with Recordset

Please Help.
I have been having an ongoing problem on a few sites I have been building using SQL SERVER 2000 and plain old ASP. The issue is if I pull, for example Select * from tbl_service where serviceID=10 let's say there are 40 fields I am pulling and want to display on a page. For example

Set cn2 = Server.CreateObject("ADODB.Connection")
cn2 = "DSN=SQS4767; UID=dba4767; PWD=kw241r;"
Set adoRec2 = Server.CreateObject("ADODB.Recordset")
'strSQL="SELECT * from tbl_service where serviceID=" & serviceID
strSQL="SELECT *, tbl_dbclubs.clubName, tbl_client.clientLastname, tbl_client.clientFirstname, tbl_client.clientMiddle FROM tbl_service INNER JOIN tbl_client ON tbl_service.clientiD = tbl_client.clientID INNER JOIN tbl_dbclubs ON tbl_service.clientClub = tbl_dbclubs.clubID where serviceID=" & serviceID

'Query the database
'response.write strSQL

adoRec2.Open strSQL, cn2

if not adoRec2.eof then
response.write "1:service_name2:" & service_name2

response.write "<br>2:service_type2:" & service_type2

clientName=adoRec2("clientFirstname") & " " & adoRec2("clientLastname")

response.write "<br>4:service_cat2" & service_cat2

response.write "<br>5:service_desc2:" & service_desc2

response.write "<br>6:service_assessed2" & service_assessed2

service_assessed_time2=adoRec2("service_assessed_t ime")
response.write "<br>7:service_assessed_time2" & service_assessed_time2

response.write "<br>7:service_hrsreq2" & service_hrsreq2

response.write "<br>8:service_isedreq2:" & service_isedreq2

service_estcompletedate2=adoRec2("service_estcompl etedate")
response.write "<br>9:service_estcompletedate2:" & service_estcompletedate2

service_parts_status2=adoRec2("service_parts_statu s")
response.write "<br>10:service_parts_status2:" & service_parts_status2
end if

What happens is that there is usually 1 or 2 fields that cause the rest to not show up. For example right now the only variable that gets displayed is service_isedreq2 all others don't display. If I comment out this line 3 variables will display after it, etc. It seems random but some variables cause the ones below it in the code to not print. Any ideas?

Sep 18 '06 #1
0 1285

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by M.C. Scheffers | last post: by
3 posts views Thread by M.C. Scheffers | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.