469,626 Members | 1,065 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

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

serviceID=request.QueryString("serviceID")
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
adoRec2.movefirst
service_name2=adoRec2("service_name")
response.write "1:service_name2:" & service_name2

service_type2=adoRec2("service_type")
response.write "<br>2:service_type2:" & service_type2

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

service_cat2=adoRec2("service_cat")
response.write "<br>4:service_cat2" & service_cat2

service_desc2=adoRec2("service_desc")
response.write "<br>5:service_desc2:" & service_desc2

service_assessed2=adoRec2("service_assessed")
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

service_hrsreq2=adoRec2("service_hrsreq")
response.write "<br>7:service_hrsreq2" & service_hrsreq2

service_isedreq2=adoRec2("service_isedreq")
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?

Peter
Sep 18 '06 #1
0 1266

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 gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.