-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: BalajiKrishnan
Message 1 in Discussion

I Have a Combo box and a textarea in a form,so when I change the option in the combo 
box i need to fetch the data from the database and put it in the textarea.   See the 
code    <% Dim strValue Dim strHLines strValue = Request.QueryString("key")  strDate = 
FormatDateTime(date(),vbGeneralDate)  strDBPath = Server.MapPath("\cat.mdb")  ' Create 
a Connection using OLE DB  Set cnn = Server.CreateObject("ADODB.Connection")  ' This 
line is for the Access sample database: cnn.Open 
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";" <% Dim strValue Dim 
strHLines strValue = Request.QueryString("key") strDate = 
FormatDateTime(date(),vbGeneralDate)     strDBPath = Server.MapPath("\cat.mdb")  ' 
Create a Connection using OLE DB Set cnn = Server.CreateObject("ADODB.Connection")  ' 
This line is for the Access sample database: cnn.Open 
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"   strARGQRY = 
"SELECT top 1 * FROM cat1 where Cat ='"& strValue & "' and Date1 = #" & strDate & "#" 
Set rs = cnn.Execute(strARGQRY) If not rs.eof then   strHLines = rs("hline")  end if  
Set rs = Nothing cnn.Close Set cnn = Nothing  %>
strARGQRY = "SELECT top 1 * FROM cat1 where Cat ='"& strValue & "' and Date1 = #" & 
strDate & "#"
Set rs = cnn.Execute(strARGQRY)
If not rs.eof then  strHLines = rs("hline") 
end if Set rs = Nothing
cnn.Close
Set cnn = Nothing  %>  <select size="1" name="cmbCategory" onChange="fillNews()">    
<option value="">select</option>
   <option value="national">National</option>
    <option value="state">State</option>
    <option value="city">City</option>
    <option value="district">District</option>
    <option value="business">Business</option>
    <option value="foreign">Foreign</option>
    <option value="sports">Sports</option>   <script language=Javascript>  
language=Javascript>
</BODY></HTML></SCRIPT>  function fillNews()  {  var strKey = 
document.frmdh.cmbCategory.value document.frmdh.action="Index.asp?key=" + strKey ;  
document.frmdh.submit();  } </script>   So it is working fine,The value from the 
database is getting filled in the textarea...but the combo box value is getting to the 
default value..but of the submit... so how can i solve this..   Balaji  

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to