Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


ASP xml/SQL

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,28451
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> ASP xml/SQL
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 ASP xml/SQL - 11/29/2005 9:37:16 PM   
  ptaz

 

Posts: 13
Score: 0
Joined: 11/18/2005
Status: offline
Hi

I hope you can help.

I have an asp page that emails form elements.  I need to add 2 drop list in that form, 1. Collection Date and 2. Collection Time.  I need to get the list dynamicaly with xml or sql.  How would I do this.  I would also need a front end to add/edit the xml or sql for the collection date and time.

Dose anyone no how I can do this.  Could you please show me some examples and code.

thanks
 
 
Post #: 1
 
 RE: ASP xml/SQL - 12/5/2005 2:34:18 AM   
  csamuels


Posts: 42
Score: 0
Joined: 9/26/2005
Status: offline
im pulling a list of users from a access db. 

sub openconn ' open a connection to access db'
dim tries
set conn = CreateObject("ADODB.Connection") 'prep connection'
set rs = CreateObject("ADODB.Recordset") ' prep recordset'
tries = 0 ' clear tries counter'
do 'try to open connection to the db
   conn.open "DRIVER={Microsoft Access Driver (*.mdb)};" &_  'CHANGE THIS STRING FOR SQL CONNECTION
             "DBQ=" & RouteFile & ";DefaultDir=;UID=;PWD=;"
   tries = tries + 1
   if (err.number <> 0) then 'if errored, close this connection
     conn.close
   end if
Loop While (Err.Number<>0) And tries < 10 'if errored, try again. MAX TRIES = 10
end sub

sub closeconn ' close the connection to the db
rs.close
set rs = nothing
conn.close
set conn = nothing
end sub

function getuwlist
query = "Select uw, uwadj from underwriters order by uwadj"
rs.open query, conn
if rs.eof then
  getuwlist = "<option>NO UWS FOUND</option>"
  exit function
else
  do until rs.eof
    getuwlist = getuwlist & "<option>" & rs.fields("uwadj").value & "-" & rs.fields("uw").value & "</option>"
    rs.movenext
  loop
  getuwlist = getuwlist & "</select>"
end if   
end function 

...

case "modify"
openconn
uwdroplist = getuwlist
closeconn
agentcode = Request.QueryString("code") %>
<form action="<%= request.servervariables("SCRIPT_NAME") %>" method="get" name="addcode">
<input type="hidden" name="action" value="confirmmod">
Agent Code = <input type="textbox" value="<% response.write agentcode %>" name="code"><br>
<%  response.write "Personal Lines UW = <select name=puwpick>" & uwdroplist &_
                 "<br> Commerical Lines UW = <select name=cuwpick>" & uwdroplist %>
<br><br><input type="submit" value="Save UWs">
</form>



looks like this 

< Message edited by csamuels -- 12/5/2005 2:36:08 AM >

(in reply to ptaz)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> ASP xml/SQL Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts