SEARCH YOUR SOLUTION HERE  

how to omit row in a table help?

do while not rs.EOF
if nCount Mod 2 = 0 then
szColour = " bgcolor=whitesmoke"
else
szColour = " bgcolor=white"
end if
nCount = nCount + 1
Response.Write("" & rs("FieldDisplayName") & _
"")
Response.Write("")
szColour = szColour & " align=middle"
if rsData.EOF = false and rsData.BOF = false then
do while not rsData.EOF
if IsNull(rsData(CStr(rs("FieldName")))) = true then
Response.Write("-")
else
select case rs("FieldName")
case "AcadiaFurnishingName"
if CInt(rsData("RemovalistNumber")) = 1 then
if ISNULL(rsData(CStr(rs("FieldName")))) = false then
Response.Write("" & CStr(rsData(CStr(rs("FieldName")))) & _
"")
else
Response.Write("-")
end if
end if
case "NumberOfRooms"
if CInt(rsData("RemovalistNumber")) = 1 then
if ISNULL(rsData(CStr(rs("FieldName")))) = false then
Response.Write("" & FormatNumber(rsData(CStr(rs("FieldName"))), 0, true) & _
"")
else
Response.Write("-")
end if
end if
case "BenefitID"
Response.Write("" & rsData("ExpType") & _
"")
case "SupplierID"
if rsData("ShowSupplierName") 0 then
Response.Write("" & rsData("SupplierName") & "")
else
Response.Write("-")
end if
case "ManagerID"
Response.Write("" & rsData("FullName") & _
"")
case "Comments"
if len(rsData("FixedComments")) > 50 then
Response.Write("")
else
Response.Write("")
end if
Response.Write(rsData("FixedComments"))
Response.Write("")
case else
select case rsData(CStr(rs("FieldName"))).Type
case 135
Response.Write("" & FormatDateTime(rsData(Cstr(rs("FieldName"))), vbShortDate) & "")
case 11
if rsData(CStr(rs("FieldName"))) = 0 then
Response.Write("-")
else
Response.Write("Yes")
end if
case 131
Response.Write("" & FormatNumber(rsData(CStr(rs("FieldName"))), 2, true) & _
"")
case else
Response.Write("" & rsData(CStr(rs("FieldName"))) & _
"")
end select
end select
end if
select case rs("FieldName")
case "AcadiaFurnishingName", "NumberOfRooms"
if CInt(rsData("RemovalistNumber")) = 1 then
Response.Write("")
end if
case else
Response.Write("")
end select

rsData.MoveNext
loop
end if
rsData.MoveFirst
Response.Write("")
rs.MoveNext
Hi , this is one of the web pages,I hope I have given enough code for somebody to help me. So the idea is that we have check boxes in our system, if a particular check box is selected then the Supplier Name is displayed and if not it displays a "-", and that works fine,but I need to not only make this work in a way that it doesn't display the name if value is zero,but to hide the entire row if the value is zero and then display the row if the value is not zero.

I haven't been able to work out how to do that,all of my attempts mess up the whole thing, so I was hoping that somebody could help me.

Response.Write("" & rs("FieldDisplayName") & _
"")

FieldDisplayName represents the heading,it is bold and in the next column it is the value against that heading, but how to omit the entire row I don't know.


Posted On: Friday 26th of October 2012 04:42:04 AM Total Views:  347
View Complete with Replies




Related Messages:

Can't read query string if default index file name is omitted?   (186 Views)
Is there an issue with IIS or ASP Classic where *Request.ServerVariables("QUERY_STRING")* returns blank if no default file name is given in the URL On my local developer machine, I can do http://localhost/xslt/opcs/abc which returns "opcs/abc". However, on our ancient web server, it returns nothing. I have to explicitly give it the default file name in the URL. Like so http://localhost/xslt/default.aspopcs/abc While nothing too major, it is a little bit of a annoyance. One way I can maybe think of remidying the problem is have Javascript read the URL and return everything after the . Unfortunately, I do not know what version of IIS or ASP we are using. Thank you.
asp&sql server: zero's omitted from passed value   (301 Views)
hi , when i try passing a numeric value as a string("0004") using asp to a stored procedure, the value is stored as 4 and not as 0004 in the table. In the table and stored procedure the value type is nvarchar. can anyone help
Updating rows   (86 Views)
I have one file thats kinda doing a lot here, Let me explain this as best as I can. First im loading a txt file into my database. This part works fine but im adding it to help you help me better. Code: Set objFSO = Server.CreateObject("Scripting.FileSystemObject") strURL = Server.MapPath("video.xls") Set objFile = objFSO.OpenTextFile(strURL) Do While Not objFile.AtEndOfStream strText = objFile.readLine arrText = split(strText, """,""", 12) releasedate = right(arrText(0), len(arrText(0)) - inStr(arrText(0), ",")) releasedate = replace (releasedate, Chr(34), "") title = replace (arrText(1), Chr(34), "") publisherstudio = replace (arrText(2), Chr(34), "") format = replace (arrText(3), Chr(34), "") itemnumber = replace (arrText(4), Chr(34), "") upc = replace (arrText(5), Chr(34), "") mfgpn = replace (arrText(6), Chr(34), "") msrp = replace (arrText(7), Chr(34), "") custcost = replace (arrText(8), Chr(34), "") boxsize = replace (arrText(9), Chr(34), "") onhandqty = replace (arrText(10), Chr(34), "") genre = replace (arrText(11), Chr(34), "") mtype = "music" if replace (arrText(11), Chr(34), "") = "JAZZ" or replace (arrText(11), Chr(34), "") = "RHYTHM & BLUES" or replace (arrText(11), Chr(34), "") = "BLUES" or replace (arrText(11), Chr(34), "") = "CLASSICAL" or replace (arrText(11), Chr(34), "") = "BIG BAND" or replace (arrText(11), Chr(34), "") = "GOSPEL" or replace (arrText(11), Chr(34), "") = "MUSIC VIDEO & CONCERTS" or replace (arrText(11), Chr(34), "") = "MUSICAL-PERFORMING ARTS" or replace (arrText(11), Chr(34), "") = "MUSICAL" or replace (arrText(11), Chr(34), "") = "POP / ROCK" then strSQL = "INSERT into tb_main(ReleaseDate,Title,PublisherStudio,Format,ItemNumber,UPC,MFGPN,MSRP,CustCost,BoxSize,OnHandQty,Genre,type) values('" & releasedate & "','" & title & "','" & publisherstudio & "','" & format & "','" & itemnumber & "','" & upc & "','" & mfgpn & "','" & msrp & "','" & custcost & "','" & boxsize & "','" & onhandqty & "','" & genre & "','" & mtype & "')" adoCon.Execute strSQL end if end if Loop Set objFSO = Nothing Now what im doing here is taking another txt file with some more info that I would like to add to what I just added above. So I use an sql statment like below where I select the item number from what Ive added in the adbove code with the sql WHERE. But, for some reason it just keeps on adding new rows from the txt file from the last code I used. But heres that code Code: Set objFSO = Server.CreateObject("Scripting.FileSystemObject") strURL = Server.MapPath("content/Video.txt") Set objFile = objFSO.OpenTextFile(strURL) Do While Not objFile.AtEndOfStream strText = objFile.readLine itemnum = rsitems("itemnumber") If itemnum "" then itemnum = itemnum End If arrText = split(strText, "|") description1 = replace (arrText(22), Chr(63), "") description2 = replace (description1, chr(34), "") description = replace (description2, chr(39), "") height = arrText(7) width = arrText(8) length = arrText(9) weight = arrText(10) caseheight = arrText(11) casewidth = arrText(12) caselength = arrText(13) caseweight = arrText(14) rating = arrText(15) itemnumber = arrText(18) strSQL = "UPDATE tb_main SET tb_main.Description = '" & description & "', tb_main.height = '" & height & "', tb_main.width = '" & width & "', tb_main.length = '" & length & "', tb_main.weight = '" & weight & "', tb_main.caseheight = '" & caseheight & "', tb_main.casewidth = '" & casewidth & "', tb_main.caselength = '" & caselength & "', tb_main.caseweight = '" & caseweight & "', tb_main.rating = '" & rating & "' WHERE tb_main.ItemNumber = '" & itemnumber & "'" adoCon.Execute strSQL Loop Set objFSO = Nothing Now Ill attach the entire code on the page to better assit. There entire page actualy has 4 files its pretty much just doubling what I showed you above. Code: strsql = "select * from tb_main" rsitems.locktype = 2 rsitems.cursortype = 3 rsItems.Open strSQL, adoCon Set objFSO = Server.CreateObject("Scripting.FileSystemObject") strURL = Server.MapPath("video.xls") Set objFile = objFSO.OpenTextFile(strURL) Do While Not objFile.AtEndOfStream strText = objFile.readLine arrText = split(strText, """,""", 12) releasedate = right(arrText(0), len(arrText(0)) - inStr(arrText(0), ",")) releasedate = replace (releasedate, Chr(34), "") title = replace (arrText(1), Chr(34), "") publisherstudio = replace (arrText(2), Chr(34), "") format = replace (arrText(3), Chr(34), "") itemnumber = replace (arrText(4), Chr(34), "") upc = replace (arrText(5), Chr(34), "") mfgpn = replace (arrText(6), Chr(34), "") msrp = replace (arrText(7), Chr(34), "") custcost = replace (arrText(8), Chr(34), "") boxsize = replace (arrText(9), Chr(34), "") onhandqty = replace (arrText(10), Chr(34), "") genre = replace (arrText(11), Chr(34), "") mtype = "music" strSQL = "INSERT into tb_main(ReleaseDate,Title,PublisherStudio,Format,ItemNumber,UPC,MFGPN,MSRP,CustCost,BoxSize,OnHandQty,Genre,type) values('" & releasedate & "','" & title & "','" & publisherstudio & "','" & format & "','" & itemnumber & "','" & upc & "','" & mfgpn & "','" & msrp & "','" & custcost & "','" & boxsize & "','" & onhandqty & "','" & genre & "','" & mtype & "')" adoCon.Execute strSQL end if end if Loop Set objFSO = Nothing Set objFSO = Server.CreateObject("Scripting.FileSystemObject") strURL = Server.MapPath("music.xls") Set objFile = objFSO.OpenTextFile(strURL) Do While Not objFile.AtEndOfStream strText = objFile.readLine arrText = split(strText, """,""", 12) itemnum = rsitems("itemnumber") If itemnum "" then itemnum = CStr(itemnum) End If releasedate = right(arrText(0), len(arrText(0)) - inStr(arrText(0), ",")) releasedate = replace (releasedate, Chr(34), "") title = replace (arrText(1), Chr(34), "") publisherstudio = replace (arrText(2), Chr(34), "") format = replace (arrText(3), Chr(34), "") itemnumber = replace (arrText(4), Chr(34), "") upc = replace (arrText(5), Chr(34), "") mfgpn = replace (arrText(6), Chr(34), "") msrp = replace (arrText(7), Chr(34), "") custcost = replace (arrText(8), Chr(34), "") boxsize = replace (arrText(9), Chr(34), "") onhandqty = replace (arrText(10), Chr(34), "") genre = replace (arrText(11), Chr(34), "") mtype = "music" strSQL = "INSERT into tb_main(ReleaseDate,Title,PublisherStudio,Format,ItemNumber,UPC,MFGPN,MSRP,CustCost,BoxSize,OnHandQty,Genre,type) values('" & releasedate & "','" & title & "','" & publisherstudio & "','" & format & "','" & itemnumber & "','" & upc & "','" & mfgpn & "','" & msrp & "','" & custcost & "','" & boxsize & "','" & onhandqty & "','" & genre & "','" & mtype & "')" adoCon.Execute strSQL end if end if Loop Set objFSO = Nothing Set objFSO = Server.CreateObject("Scripting.FileSystemObject") strURL = Server.MapPath("content/Video.txt") Set objFile = objFSO.OpenTextFile(strURL) Do While Not objFile.AtEndOfStream strText = objFile.readLine itemnum = rsitems("itemnumber") If itemnum "" then itemnum = itemnum End If arrText = split(strText, "|") description1 = replace (arrText(22), Chr(63), "") description2 = replace (description1, chr(34), "") description = replace (description2, chr(39), "") height = arrText(7) width = arrText(8) length = arrText(9) weight = arrText(10) caseheight = arrText(11) casewidth = arrText(12) caselength = arrText(13) caseweight = arrText(14) rating = arrText(15) itemnumber = arrText(18) strSQL = "UPDATE tb_main SET tb_main.Description = '" & description & "', tb_main.height = '" & height & "', tb_main.width = '" & width & "', tb_main.length = '" & length & "', tb_main.weight = '" & weight & "', tb_main.caseheight = '" & caseheight & "', tb_main.casewidth = '" & casewidth & "', tb_main.caselength = '" & caselength & "', tb_main.caseweight = '" & caseweight & "', tb_main.rating = '" & rating & "' WHERE tb_main.ItemNumber = '" & itemnumber & "'" adoCon.Execute strSQL Loop Set objFSO = Nothing Set objFSO = Server.CreateObject("Scripting.FileSystemObject") strURL = Server.MapPath("content/music.txt") Set objFile = objFSO.OpenTextFile(strURL) Do While Not objFile.AtEndOfStream strText = objFile.readLine arrText = split(strText, "|") itemnum = rsitems("itemnumber") If itemnum "" then itemnum = CStr(itemnum) End If description1 = replace (arrText(22), Chr(63), "") description2 = replace (description1, chr(34), "") description = replace (description2, chr(39), "") height = arrText(7) width = arrText(8) length = arrText(9) weight = arrText(10) caseheight = arrText(11) casewidth = arrText(12) caselength = arrText(13) caseweight = arrText(14) rating = arrText(15) itemnumber = arrText(18) strSQL = "UPDATE tb_main SET tb_main.Description = '" & description & "', tb_main.height = '" & height & "', tb_main.width = '" & width & "', tb_main.length = '" & length & "', tb_main.weight = '" & weight & "', tb_main.caseheight = '" & caseheight & "', tb_main.casewidth = '" & casewidth & "', tb_main.caselength = '" & caselength & "', tb_main.caseweight = '" & caseweight & "', tb_main.rating = '" & rating & "' WHERE tb_main.ItemNumber = '" & itemnumber & "'" adoCon.Execute strSQL Loop Set objFSO = Nothing rsitems.Close adocon.Close set rsitems = nothing set aodocon = nothing %> If I could get any extra help it will be appreciated. I know this is confusing but maybe I can explain it better over a chat or something. AIM: xteeheimanx email billyheiman@cox.net Thank you very much! Billy
Delete unaffected rows?   (112 Views)
This is an akward question...is it possible to delete rows not selected when you use LIMIT in an SQL query For instance, I use the SQL query: Code: SELECT * FROM users WHERE userID = " & userID & " LIMIT 50 Say there are 59 total rows where the userID matches. How can I delete the 9 that aren't selected when LIMIT is used Is this possible, or will I have to find another way
Repetition of rows   (74 Views)
In the code below I have the problem that I get an error if rstal("talent") doesn't exist for that record. What I want to modify is that if in the record rstal("talent") is in bof or eof or doesnt exist then just show image add.jpg. not sure how this is possible. thanks a lot in advance Code: id FName LName EMailOffice EMailHome Phone1 Phone2 Mobile Talent
Help Inserting into spicific user id row   (235 Views)
I am trying to use a form to update a Row by a spicific ID#. I have 2 Forms: Status Comments I want to insert into a user that is already in the database the page can call the user ID by the Code: command. What would the SQL Insert Command be for this ACCESS DATABASE
Dynamic add of form rows   (177 Views)
I have a form on an asp page and need to dynamically add rows to it and then be able to insert the dynamic cells to a SQL database. I have tried this with JAvascript and have kind of hit a wall. Any ideas how to do it with ASP instead I want to add the next row when a user exits the last cell in the existing row.
deleting row in db - Page 2   (221 Views)
here are my codes for my two pages. courses_display Code: Untitled Document SCHOOLNAME COURSE NAME TOWN REGION PRICE START DATE FINISH DATE NOTES Admin Delete and my newrecord.asp Code: Untitled Document Record deleted. Return to lists. im getting this error now http://www.languageschoolsuk.com/removeRecord.aspr=kings im really sorry to be consing you so much trouble.
why cant open new browser?? - Page 2   (364 Views)
my problem is i need link to main pages first ./..... then, user can view list when user want........
browsing files/directories tool   (368 Views)
I am trying to make a browsing files/directories tool with ASP, and I have found some code from Microsoft Support http://support.microsoft.com/default.aspxscid=kb;EN-US;q224364 Code: - BODY { BACKGROUND: #cccccc; COLOR: #000000; FONT-FAMILY: Arial; FONT-SIZE: 10pt; } TABLE { BACKGROUND: #000000; COLOR: #ffffff; } TH { BACKGROUND: #0000ff; COLOR: #ffffff; } TD { BACKGROUND: #ffffff; COLOR: #000000; } TT { FONT-FAMILY: Courier; FONT-SIZE: 11pt; } Please choose a file/folder to view. Name Bytes KB Attributes Ext Type Date Time K However I would like to use the tool that will be put in a web server to browse files on a file server, therefore I've changed the line strPhysicalPath = Server.MapPath(strPath) Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("strPhysicalPath") TO strPhysicalPath = "\\machine_name\Folder_name" Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("strPhysicalPath") to specify the path, but it didn't work. Anyone help would be appreciate, thanks in advance! It's not due with permission, because I've tried with another piece of asp code that is able to writes on the other machine
Narrow in results while searching   (306 Views)
I need to build a search that will narrow down search as you are entering additional information in the search centre. For example, search on City by letter 'N' will dynamicly display in drop menu a full list of Cities where they letter 'N' in. By supplying additional letter next to it 'Ne' will display narrowed down results set. Is there a sample code that I can use or website This is simular to way email on yahoo works when you want to select 'To' field..
How do I design a browser to detect text file?   (183 Views)
This fyp folder should be put in C:\Inetpub\wwwroot\ Keep this window open. With the text file ap.txt at desktop Click on it and press Control + C C:\Inetpub\wwwroot\fyp\program.asp performs the 4 task 1. Extracts the text file contents from C:\Inetpub\wwwroot\ap.text 2. Insert into the table tracking_info of the database located at C:\Inetpub\wwwroot\database.mdb 3. Delete the text file located at C:\Inetpub\wwwroot\ap.text 4. The program. asp will auto refreshes in 10 seconds waiting for a new ap.txt to generate, have to physically press Control + V per 10 seconds in C:\Inetpub\wwwroot\fyp so that it can pick up the text file in order for program.asp to work. Direct the internet explorer to http://localhost/fyp/program.asp program.asp is as shown.. Upload Text in progress // The time out value is set to be 10,000 milli-seconds (or 10 seconds) setTimeout(' document.location=document.location' ,10000); 'set focus Sub doFocus opener.focus self.focus End Sub ' refresh the navigation folder opener.navFolderFromUpload "","", "" self.close Problem Problem is whenever after 10 seconds there is no ap.txt in the C:\Inetput\wwwroot\fyp folder or there is nothing in the text file, the browser directs to error page where no auto-refreshing can be performed. Question about program.asp How should I make program.asp redirect my browser to ANOTHER browser to display the messages "no text file detected or text file is empty. How should I design the other browser How do I design the codes for this browser to display no text file detected or text file is empty, it will keep refreshing until it detects the existence of the contents of ap.txt, and then redirect to program.asp to perform the functions. Anyone knows Any references
Number of rows in Recordset   (126 Views)
How can I determine the number of rows in a recordset myRecordSet.Fields.Count returns only 1 (weird!)
how to get IE Browser ,if i am entering one single word?   (368 Views)
Hi , Please help me. i have one doubt in ASP Application can we get the application page by entering a single word in browser more clearly... see i have my application in www root. called "test" folder. now if i am entering only "test" in internet explorer browser, how can it will take fist page of my application. my first page of appliation is "login.asp" from test folder please tell me how to implement it in ASP please send me the code
Display problems related to two-dim array, multiple values in some rows.   (271 Views)
Can asp narrow down errors when selecting drop down boxes?   (343 Views)
hi, I have a scenario and not sure if asp can do it. example, I have 3 drop down boxes n a page. 1st box contains all countries, 2nd box contains all locations in that country selected from the 1st box 3rd box contains all items at that particular location selected from the 2nd box i hope im not confusing anyone. would like to know if it can be done and how
Help in undrestading logic of finding two strings in 1 row - Page 2   (254 Views)
Originally Posted by Shadow Wizard you search for the string "W. van Heerde" in three different pages that's all if so it's really simple: Code: Function GetCell(cellnumber, extracturl) Const Request_POST = 1 Const Request_GET = 2 Dim extracturlArr(2),i, result extracturlArr(0) ="http://pww.xray.ms.philips.com/cmt_..._682/2_682.html" extracturlArr(1)= "http://pww.xray.ms.philips.com/cmt_..._735/2_735.html" extracturlArr(2)= "http://pww.xray.ms.philips.com/cmt_..._640/2_640.html" Set xObj = Server.CreateObject("SOFTWING.AspTear") For i = 0 to UBound(extracturlArr) strRetVal = xObj.Retrieve(extracturlArr(i),Request_G ET,"","","") result=result&FindWrappingString(strRetVal, "W. van Heerde", "") next set xobj = nothing GetCell=Result End Function Response.Write(GetCell(cellnumber, extracturl)) and have the original FindWrappingString function which I gave you in the past. no i want to search for this person in only those pages() where this "XDV060-13000 3.0" string is also mentioned inside those () tags. and when this is found then it should be listed inside a html table. then de script should search for this person only where "XDV060-13000 3.1" and when found listed in html table. and so on. , Originally Posted by Shadow Wizard ok, you have to combine that code with the code I gave you later that check, using InStr, if the current row contains both strings. I believe that giving you the whole code is not wise thing, sorry. in order to become programmer you have to write your own code, mess with existing code until it works and most important - understand what's going on in every step. just using code given by others without even knowing what's going on is the worst case and usually it does not end very well, unless you have no intention to become programmer. I'm sorry if it sounds harsh, but believe me that you'll thank me for that in the future when you'll be programmer in your own right. maybe not within one-two days but eventually everybody can learn and adopt you should be no exception. if you really need this to be done asap you can hire someone if you're the one in charge or tell your boss you need more time to learn before delving so deep to coding in case you're working for someone. I hope you'll understand the above things - you have all the tools you need. it's just matter of how to use them. Yes, u are right at the moment I am not having alot of time to learn it but in the coming months, i am going to concentrate and learn advanced programming and EXCERSING alot that when u will learn it better. Thanx any ways and no u didnt sound harsh i like honest people.
displaying all rows of records in just 1 row   (285 Views)
how can make it display in this way: Topic| Attempt| Total Score| Grade DC Basic Voltage Divider |1 |0%| F|2|50%| D |3|80%|A instead of this way using the below code: Topic| Attempt| Total Score| Grade DC Basic Voltage Divider |1 |0% F DC Basic Voltage Divider |2 |0% F Code: Topic Attempt Total Score Grade = 80 Then Grade = "A" ElseIf TotalScore >= 75 AND TotalScore < 80 Then Grade = "B+" ElseIf TotalScore >= 70 AND TotalScore < 75 Then Grade = "B" ElseIf TotalScore >= 65 AND TotalScore < 70 Then Grade = "D+" ElseIf TotalScore >= 60 AND TotalScore < 65 Then Grade = "D" ElseIf TotalScore >= 55 AND TotalScore < 60 Then Grade = "C+" ElseIf TotalScore >= 50 AND TotalScore < 55 Then Grade = "C" ElseIf TotalScore < 50 Then Grade = "F" End IF %> DC BasicVoltage Divider %
See errors in browser   (483 Views)
hello. Could somebody tell me how and where to set, to be posible, in case of any error, to see this error in the browser I suposse I need to set it in the server (to send errors to client) and also in the browser, but I don't know how. Thank you for your help
adding text to database via browser   (429 Views)
, I am trying to make a guestbook, wich should be accessable through a executable exe. I think, the easyest way to do this, is through your browser. I am looking how to add text to a database without entering text in a form, but only text in the address bar of your browser. the address should be something like this then: http://www.own3d.nl/guestbook/add_to_guestbook.asprsAddComments.Fields("Name")= ("name")rsAddComments.Fields("Comments")=("commen ts)" or something like that. i hope you can help me. Gr, Koen