Sasa Posted June 12, 2008 Report Share Posted June 12, 2008 (edited) Kā lai sagruž iekš listbox vērtības, vērtības jāņem no šā SQL'a izpildes: SELECT Izmeri.Kods FROM Izmeri GROUP BY Izmeri.Kods; ? Nolasīt ar JS no DB vērtības es protu tik nezinu kā tās salikt tajā listboksī, lai parādītos! edit: Ja nu kādam interesē tad: <script language=javascript> var out4='<select class="listbox" id=list name="states4" size="1" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 5.2cm; BORDER-BOTTOM: 0px">'; var cn = new ActiveXObject("ADODB.Connection"); var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =C:\\web_katalogs\\Katalogs.mdb;Persist Security Info=False"; cn.Open(strConn); var rs = new ActiveXObject("ADODB.Recordset"); var SQL = "SELECT Izmeri.Kods FROM Izmeri GROUP BY Izmeri.Kods;"; rs.Open(SQL, cn); while (!rs.eof) { var kods_listbox = rs("Kods"); out4 += '<option value="'+kods_listbox+'">'+kods_listbox+'</option>'; rs.MoveNext(); } document.getElementById('theExample2').innerHTML=out4; rs.Close(); cn.Close(); </SCRIPT> Edited June 12, 2008 by Sasa Link to comment Share on other sites More sharing options...
bubu Posted June 12, 2008 Report Share Posted June 12, 2008 Tavi jautājumi, Sasa, reizām (kā šoreiz) pamatīgi spārda. Link to comment Share on other sites More sharing options...
Recommended Posts