Menu
Home
About Me
Articles
Hobbies
Code Library
Flash Library
3d stuido max

 
Sub Load_Select(SQL, SelectedData, database)	
  Dim SelectDataConnection, commom_data
  Set SelectDataConnection = Server.CreateObject("ADODB.Connection")
  call openConnection(database,SelectDataConnection)
  Set commom_data = server.CreateObject("ADODB.Recordset")
    commom_data.Open SQL, SelectDataConnection
	do while not commom_data.eof 
      %><option 
	  <%If commom_data(0) = SelectedData THEN%>selected <%END IF%>
	  value=<%= commom_data(0) %>><%=commom_data(1)%><%
      commom_data.movenext
    loop
    commom_data.close
    set commom_data = Nothing
    SelectDataConnection.Close
    set SelectDataConnection = nothing
End Sub

Load_Select "SELECT ID, text FROM Table", "1", databaseName