Click here to Skip to main content
15,920,633 members
Home / Discussions / Web Development
   

Web Development

 
QuestionHow can i exclude HEADER Pin
Anonymous21-Feb-05 6:44
Anonymous21-Feb-05 6:44 
QuestionRequest QueryString Problem?? Pin
mjay200421-Feb-05 5:20
mjay200421-Feb-05 5:20 
AnswerRe: Request QueryString Problem?? Pin
satya chhikara27-Feb-05 22:31
satya chhikara27-Feb-05 22:31 
Generalabout function .exec() Pin
kinkei21-Feb-05 0:27
kinkei21-Feb-05 0:27 
GeneralVertical scroll behavior Pin
Marc Soleda20-Feb-05 23:14
Marc Soleda20-Feb-05 23:14 
General"GET" or "POST" Pin
Member 174700020-Feb-05 10:30
Member 174700020-Feb-05 10:30 
GeneralRe: "GET" or "POST" Pin
alex.barylski21-Feb-05 12:12
alex.barylski21-Feb-05 12:12 
GeneralASP multi-form database driven results page Pin
Member 174700020-Feb-05 7:46
Member 174700020-Feb-05 7:46 
Need help with this code. I can not get the onchange dropdown to display info about the selected item in the dropdown.
its alot of code, Sorry.

here is the code:

<%
' Constants ripped from adovbs.inc:
Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = &H0001

' Our own constants:
Const PAGE_SIZE = 200 ' The size of our pages.

' Declare our variables... always good practice!
Dim strURL ' The URL of this page so the form will work
' no matter what this file is named.

Dim cnnSearch ' ADO connection
Dim rstSearch ' ADO recordset
Dim strDBPath ' path to our Access database (*.mdb) file

Dim strSQL ' The SQL Query we build on the fly
Dim strSearch ' The text being looked for

Dim iPageCurrent ' The page we're currently on
Dim iPageCount ' Number of pages of records
Dim iRecordCount ' Count of the records returned
Dim I ' Standard looping variable

' Retreive the URL of this page from Server Variables
strURL = Request.ServerVariables("URL")

' Retreive the term being searched for. I'm doing it on
' the QS since that allows people to bookmark results.
' You could just as easily have used the form collection.
strSearch = Request.QueryString("search")
strSearch = Replace(strSearch, "'", "''")

' Retrieve page to show or default to the first
If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If

' Since I'm doing this all in one page I need to see if anyone
' has searched for something. If they have we hit the DB.
' O/W I just show the search form and quit.
%>














[Since we've got a very small sample DB, try a single letter
search like 's' or 'd' for an example that actually pages!]


<%
If strSearch <> "" Then
' MapPath of virtual database file path to a physical path.
' If you want you could hard code a physical path here.
strDBPath = Server.MapPath("../fpdb/agent.mdb")


' Create an ADO Connection to connect to the sample database.
' We're using OLE DB but you could just as easily use ODBC or a DSN.
Set cnnSearch = Server.CreateObject("ADODB.Connection")

' This line is for the Access sample database:
cnnSearch.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

' Build our query based on the input.
strSQL = "SELECT * " _
& "FROM agent_info " _
& "WHERE last LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR first LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "ORDER BY last;"

' Execute our query using the connection object. It automatically
' creates and returns a recordset which we store in our variable.
Set rstSearch = Server.CreateObject("ADODB.Recordset")
rstSearch.PageSize = PAGE_SIZE
rstSearch.CacheSize = PAGE_SIZE

' Open our recordset
rstSearch.Open strSQL, cnnSearch, adOpenStatic, adLockReadOnly, adCmdText

' Get a count of the number of records and pages
' for use in building the header and footer text.
iRecordCount = rstSearch.RecordCount
iPageCount = rstSearch.PageCount

If iRecordCount = 0 Then
' Display no records error.
%>


No Agents matched your search. Please try again.


<%
Else
' Move to the page we need to show.
rstSearch.AbsolutePage = iPageCurrent

' Show a quick status line letting people know where they are:
%>



<% ' displays number of records that match %>
<%= iRecordCount %> Records Found.


<%
' Display a combo box of the data in the recordset. We loop through the
' recordset displaying the fields from the table and using MoveNext
' to increment to the next record. We stop when we reach EOF.
%>

<% ' here is where I started editing file %>


<%
Do While Not rstSearch.EOF And rstSearch.AbsolutePage = iPageCurrent
%>

<%
if Request.Form("name") = rstSearch ("last") then
Response.Write ""
Response.Write oRs("last") & ", " & oRs("first") & ""
oRs.MoveNext
else
Response.Write ""
Response.Write rstSearch ("last") & ", " & rstSearch ("first") & ""
rstSearch.MoveNext
end if
loop
%>

<% ' here is where I stopped editing file %>




The following was selected : <%=Request.Form ("name")%>



<%
End If

' Close our recordset and connection and dispose of the objects
rstSearch.Close
Set rstSearch = Nothing
cnnSearch.Close
Set cnnSearch = Nothing
End If
%>
GeneralWeb Application Pin
mitthooo19-Feb-05 22:36
mitthooo19-Feb-05 22:36 
Generalimport contacts of msn/yahoo Pin
millisami18-Feb-05 20:45
millisami18-Feb-05 20:45 
QuestionHow send email with attachment???? Pin
Small Rat18-Feb-05 9:52
Small Rat18-Feb-05 9:52 
AnswerRe: How send email with attachment???? Pin
Luis Alonso Ramos19-Feb-05 12:12
Luis Alonso Ramos19-Feb-05 12:12 
GeneralRe: How send email with attachment???? Pin
Small Rat21-Feb-05 6:34
Small Rat21-Feb-05 6:34 
GeneralRe: How send email with attachment???? Pin
Member 154211923-Feb-05 2:03
Member 154211923-Feb-05 2:03 
AnswerRe: How send email with attachment???? Pin
Member 154211923-Feb-05 1:55
Member 154211923-Feb-05 1:55 
Questionwhat means proxy-connection:? Pin
ThinkingPrometheus18-Feb-05 9:06
ThinkingPrometheus18-Feb-05 9:06 
GeneralHiding HTML controls using Javascript Pin
hitu_kapadia18-Feb-05 3:08
hitu_kapadia18-Feb-05 3:08 
GeneralRe: Hiding HTML controls using Javascript Pin
Qaiser.Muhammad18-Feb-05 14:24
Qaiser.Muhammad18-Feb-05 14:24 
GeneralRe: Hiding HTML controls using Javascript Pin
hitu_kapadia21-Feb-05 2:54
hitu_kapadia21-Feb-05 2:54 
Generalplug-in in IE Pin
Pauwl18-Feb-05 2:48
Pauwl18-Feb-05 2:48 
Questionhow to set tomcat4.1 to run the java class with larger heap size Pin
kinkei17-Feb-05 20:41
kinkei17-Feb-05 20:41 
Questionhow to invoke a java class with 6 parameters within jsp which need 800M heap size Pin
kinkei17-Feb-05 20:07
kinkei17-Feb-05 20:07 
QuestionWhat programming language should I use Pin
17-Feb-05 19:56
suss17-Feb-05 19:56 
AnswerRe: What programming language should I use Pin
SimonS18-Feb-05 6:52
SimonS18-Feb-05 6:52 
GeneralMousedown event on DIV - help urgent Pin
Venkat Eswaran17-Feb-05 17:12
Venkat Eswaran17-Feb-05 17:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.