|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
newby needs no record found help
ok I'm new to ASP but I have everything working great I have a form in which client can look up status i want to be able to redirect to a no record found page when a wrong id number is entered here is website http://www.cargogroupllc.com/cargotracking.asp example of good record enter 12321 example of bad record 33333333 please help this is last thing I need to accomplish
![]() code for page <% strSearch = Request.Form("search") If strSearch <> "" Then Dim strConnect, SQL Dim RS strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("securefiles/ITtracking.mdb") & ";" SQL = "SELECT * FROM ITTable WHERE INSTR(ITTable.ITNumber,'" & strSearch & "')" Set RS = Server.CreateObject("Adodb.Recordset") 'Used for pulling main categories from DB RS.Open SQL,strConnect 'If Len(strSearch) > 1 AND LCase(strSearch) = LCase(RS("Name")) Then Response.Write RS("ITNumber") & "<BR><BR>" Response.Write RS("DateArrived") & "<BR><BR>" Response.Write RS("RefNumber") & "<BR><BR>" Response.Write RS("Quantity") & "<BR><BR>" Response.Write RS("PUDate") & "<BR><BR>" Response.Write RS("PUNumber") & "<BR><BR>" Response.Write RS("OriginalIT") & "<BR><BR>" Response.Write RS("ValidatedIT") & "<BR><BR>" Response.Write RS("CustomsRelease") & "<BR><BR>" Response.Write RS("ShippingTally") & "<BR><BR>" Response.Write RS("NVOCCRelease") & "<BR><BR>" Response.Write RS("PaperlessIT") & "<BR><BR>" 'End If 'If Len(strSearch) <= 0 Then ' Response.Write "Sorry no record & "<BR>" ' Response.Write RS(sorry no record) & "<BR><BR>" 'End If RS.MoveNext RS.Close End If %> |
|
#2
|
||||
|
||||
|
Hi, I don't understand your IF statement, can u explain it to me? Why are you comparing
the number entered with the RS("Name") Field? if you wan't to know when a RS is empty use this function: rs.open strSQL, conn If rs.BOF then 'IF RS is EMPTY 'CODE TO REDIRECT TO A NO RECORD FOUND PAGE else 'CODE TO EXTRACT THE VALUES FROM THE RECORD SET end if |
|
#3
|
|||
|
|||
|
got rid of the if statments used rs.BOF works perfect thank you for the help
Quote:
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > newby needs no record found help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|