Click here to Skip to main content
15,908,444 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: suggestions for sliding images on my website Pin
Tom John10-Jun-07 22:59
Tom John10-Jun-07 22:59 
QuestionHOW TO DECLARE UBOUND Pin
hifiger20049-Jun-07 7:07
hifiger20049-Jun-07 7:07 
AnswerRe: HOW TO DECLARE UBOUND Pin
Guffa9-Jun-07 8:35
Guffa9-Jun-07 8:35 
AnswerFOR...NEXT IN ASP.NET [modified] Pin
hifiger20049-Jun-07 5:03
hifiger20049-Jun-07 5:03 
GeneralRe: FOR...NEXT IN ASP.NET Pin
Guffa9-Jun-07 8:32
Guffa9-Jun-07 8:32 
GeneralRe: FOR...NEXT IN ASP.NET Pin
hifiger200412-Jun-07 4:54
hifiger200412-Jun-07 4:54 
QuestionERROR in ds.Tables.Item("SampleID").ToString() [modified] Pin
hifiger20049-Jun-07 3:46
hifiger20049-Jun-07 3:46 
AnswerRe: ERROR in ds.Tables.Item("SampleID").ToString() Pin
Tom John11-Jun-07 9:00
Tom John11-Jun-07 9:00 
QuestionHow to convert a single http page into https using SSL in IIS? Pin
vijay_838-Jun-07 20:29
vijay_838-Jun-07 20:29 
AnswerRe: How to convert a single http page into https using SSL in IIS? Pin
Expert Coming8-Jun-07 23:45
Expert Coming8-Jun-07 23:45 
QuestionASP.Net Stored Procedure Pin
hifiger20048-Jun-07 6:17
hifiger20048-Jun-07 6:17 
AnswerRe: ASP.Net Stored Procedure Pin
_AK_10-Jun-07 21:10
_AK_10-Jun-07 21:10 
QuestionPrevent File-> save as Pin
Mri1a8-Jun-07 1:32
Mri1a8-Jun-07 1:32 
AnswerRe: Prevent File-> save as Pin
Christian Graus8-Jun-07 1:41
protectorChristian Graus8-Jun-07 1:41 
AnswerRe: Prevent File-> save as Pin
Shog98-Jun-07 5:56
sitebuilderShog98-Jun-07 5:56 
GeneralRe: Prevent File-> save as Pin
Johnny ²8-Jun-07 9:47
Johnny ²8-Jun-07 9:47 
GeneralRe: Prevent File-> save as Pin
Christian Graus10-Jun-07 13:45
protectorChristian Graus10-Jun-07 13:45 
AnswerRe: Prevent File-> save as Pin
Bradml9-Jun-07 0:41
Bradml9-Jun-07 0:41 
QuestionStill have problems with dropdownlist Pin
matjame8-Jun-07 0:44
matjame8-Jun-07 0:44 
Hi all.

I managed to get this code but cant tell why it doesnt show the results.Its suppose to display the dropdownlist with all the values from the database.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<%
Option Explicit

'-- Variables we are using
dim objConn, objRS, objRS2, strSQL

'-- Define our objects
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
Set objRS2 = Server.CreateObject("ADODB.Recordset")

'-- Database path and Data provider
objConn.ConnectionString = Server.MapPath("C:\dropdowns.mdb")
objConn.Provider = "Microsoft.Jet.OLEDB.4.0"
objConn.Open

'-- Sub Procedure that builds the dropdown list
Sub showDropDownList(c, r, table)

'-- SQL Statement
strSQL = "SELECT * FROM " & tblDropDownTest & " ORDER BY Title ASC"
'-- Execute our SQL statement and store the recordset
Set r = c.Execute(strSQL)

'-- If we have records to return
if r.eof = false then
'-- Open a form/select tag
Response.Write ""
Response.Write "" & vbCrLf
Response.Write "Choose...."
'-- loop and build each database entry as a selectable option
While r.EOF = false
Response.Write "" _
& r.Fields("Title").Value & "" & vbCrLf
'-- Move recordset to the next value
r.movenext
Wend
else
response.write"<"Sorry, no records selected">"
end if
'-- close select/form tags
Response.Write "" & vbCrLf

End Sub

'-- Sub Procedure that builds the dropdown list
Sub showDropDownList2(c, r, table)

'-- SQL Statement
strSQL = "SELECT * FROM " & tblDropDownTest & " ORDER BY Title ASC"
'-- Execute our SQL statement and store the recordset
r.Open strSQL, c, 3, 3

'-- If we have records to return
if r.eof = false then
'-- Open a form/select tag
Response.Write ""
Response.Write "" & vbCrLf
'-- loop and build each database entry as a selectable option
'filter
r.Filter = ("Type = 'fruit'")
Response.Write "Choose...."
Response.Write ""
While r.EOF = false
Response.Write "" _
& r.Fields("Title").Value & "" & vbCrLf
'-- Move recordset to the next value
r.movenext
Wend

r.Filter = adFilterNone

r.Filter = ("Type = 'veg'")
Response.Write ""
While r.EOF = false
Response.Write "" _
& r.Fields("Title").Value & "" & vbCrLf
'-- Move recordset to the next value
r.movenext
Wend
end if
'-- close select/form tags
Response.Write "" & vbCrLf

End Sub
%>




<title>Dynamic dropdown lists in ASP(VBScript) - designplace.org






Dynamic dropdown lists using Active Server Pages and Microsoft Access


Below is an example of a drop down list, dynamically populated from a
database table.




<%
' -- Call the sub procedure to build the drop down list, with the connection and recordset objects and the source table (In quotes).
call showDropDownList(objConn, objRS, "tblDropDownTest")
Sub showDropDownList(c, r, table)

'-- SQL Statement
strSQL = "SELECT * FROM " & tblDropDownTest & " ORDER BY Title ASC"
'-- Execute our SQL statement and store the recordset
Set r = c.Execute(strSQL)

'-- If we have records to return
if r.eof = false then
'-- Open a form/select tag
Response.Write "

"
Response.Write "" & vbCrLf
Response.Write "Choose...."
'-- loop and build each database entry as a selectable option
While r.EOF = false
Response.Write "" _
& r.Fields("Title").Value & "" & vbCrLf
'-- Move recordset to the next value
r.movenext
Wend
else
response.write"<"Sorry, no records selected">"
end if
'-- close select/form tags
Response.Write "" & vbCrLf

End Sub
%>


Here is the same drop down list, but this time it has been filtered to show
fruit first under a heading, then veg.



<%
' -- Call the sub procedure to build the drop down list, with the connection and recordset objects and the source table (In quotes).
call showDropDownList2(objConn, objRS2, "tblDropDownTest")
%>


© designplace.org - Feb 2003






Frown | :(

kagiso

AnswerRe: Still have problems with dropdownlist Pin
Viral Upadhyay8-Jun-07 3:57
Viral Upadhyay8-Jun-07 3:57 
AnswerRe: Still have problems with dropdownlist Pin
hiral_shah8-Jun-07 19:50
hiral_shah8-Jun-07 19:50 
QuestionFILE input field Pin
Aleksandar Cajic7-Jun-07 23:46
Aleksandar Cajic7-Jun-07 23:46 
AnswerRe: FILE input field Pin
Guffa8-Jun-07 10:26
Guffa8-Jun-07 10:26 
QuestionConverting Request object to WebRequest in asp.net Pin
amitar277-Jun-07 9:18
amitar277-Jun-07 9:18 
AnswerRe: Converting Request object to WebRequest in asp.net Pin
Guffa8-Jun-07 9:45
Guffa8-Jun-07 9:45 

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.