Jump to content

kastellu

Members
  • Posts

    39
  • Joined

  • Last visited

Posts posted by kastellu

  1. Hello,I have one question. How I could create a page with objects (for example pictures) and when a user (that was registered and at the moment he is loged in) would click and look at the picture , his session or id of that user and id of selected picture would be inserted into table. So at that moment i would get information who was looking at that picture.Any examples?Best regards,K

  2. Hello,Firstly, thanks for your replay. No that is not it! I am working in some report software, that is java coded. All objects are just drag and drop, with that i mean that you only grag a selectbox in to report and set some properties, and it works. But the only way you can customize your reports is with some HTML item , where you can write in a javascript that can corespond to that report.. The problem is that i get the values in to some selectbox (i get only need value that is prefiltered from some other object) , but since i wouldn't like to see the result in a selectbox i would like to hide that selectbox(visibility it is a propertie of this object) object and its value send to text item or tag if you like it (that tag has a object name as well). So what i am trying to do is to put that HTML object where that script would be written - select value from hidden selectbox(SELECTBOXVALUE - name) and writte it into tag object (TAGEVALUE-name) - this is only a regular tag in main page and not pop up.I hope you understand. The report software is COGNOS BI 8.2Thanks for your help!Best regards,K

  3. Hello,I don't have any clue about javascript , so that is why i am asking you about this. How to writte a script that will give me a value from listbox and it would be pasted into text item or just be a text. So ,,... , value BIKE from a listbox (name of object is LISTBOX1) as an object to ,....,BIKE in a text ite (name of a text item is TEXTITEM2).Can you please give me a full script.Thank youK

  4. Hello,At bottom you can see the code of SQL procedure that inserts the value to a table1. And the test asp page which has a form with where the value is insertet and submited. The problem is that i don t know how to send the value to an executed procedure , that is wrong and that is the reason why i get an error that the parameter for procedure is not provided. I know that i need to provide the Web value from a form at the time that the procedure is executed. Can you help me with this problem. The procedure in SQL works but when a button is submited the error ...Thanks,KASP test page

    <form name = "test" action = "test.asp?sub=add" method = "POST"><input type = "text" name = "ValueWEB"><input type = "submit" name ="insert" value = "enter"></form><%ValueWEB = RequestForm("ValueWEB")set cnn = server.createobject("ADODB.Connection")cnn.open "PROVIDER = SQLOLEDB; DATA SOURCE = TESTSERVER; UID = sa; PWD = test123; DATABASE =db"If ValueWEB <> "" thencnn.testprocedureend if%>

    testprocedure in SQL SERVER 2005

    USE dbGOCREATE PROCEDURE testprocedure(   @ValueWEB varchar(30))ASINSERT INTO ValueTable(  Value)VALUES(  @ValueWEB)

  5. I'm the network administrator of a pool company.I am expected to build a website with certain features such as, enabling a current customer to log into the website to see the time schedule on their pool. My biggest issue here is... I've never had any sort of experience with asp or sql or anything outside of HTML CSS and Javascript. I've looked through the tutorials from http://www.w3schools.com/ , but the tutorials are some what limited in my opinion. If someone could show me some examples that would be great.--Also: I am also creating a page that will let new customers insert their information so that we may reach them very easy.All I have is the form and input tags. Now all I need to know is how to send this information in an organized and readable manner to my boss's email. Please send me in the right direction, ty. :)
    Firstly i would read some tutorials and try some examples , how to write in to DB and how to read from DB, that are on w3schools , secondly i would work with simple web page that has funcionalities of updating the data from DB. I would recomend that you go trought few examples and trough tutorials so that you will understand what is all about ( conn , if , case , sql statement, cn.close, update,...)
  6. Hello, Could someone help me with this one. I would like to change the order by when clicking on link.My code:

    <a herf = "index.asp?sort=asc">Products<%sort = request.querystring ("sort")If sort = asc then SORTBY = ascElseSORTBY = descsql ="SELECT * FROM tblExample ORDER BY '& SORTBY &';"%>

    Am i on a right way or did i lose it fully.Thank you

  7. Hello,How can you create a loop that will after a limited nuber of row or exported data create a new page and loop on , and again create new page,....So if you have 1000 row, i would like to limit this on to subpages to ever hundred or less rows per page. I don t eaven know is there other function in asp that creates that,..Thank you an example woul be welcome.L

  8. Hello,Let me first try to explain you what i am trying to do! I have created an page default.asp where a loop on vaules from db is made and i get a list of data.HOMESUPPORTSOFTWAREHARDWARENow i have made an querystring , so if i chose one of the values , for example SOFTWARE i will get next page:HOMESUPPORTSOFTWAREHARDWAREWindowsXPWindows2000Windows98Windows95How do i get this data. When i chose a SOFTWARE the querystring takes an value and starts if sentence If Request.QueryString (VALUE) ="Software"<!--#include file="softwarelist.asp"-->End IF... O.K. the problem comes now in softwarelist where:WindowsXPWindows2000Windows98Windows95is i have another querystring so that if i click for example WindowsXPI will get sub content(zip,rar,iso,..) . If i run software list by itself works fine, but if i run it unde default.asp i will get with get with screen only with fist values of SOFTWARE, HARDWARE,...I know that the problem is in querystringdefault.asp?value=Software works , but when you call sub querystring t he problem comes because i lose default.asp?value=Software and is changed into whatever the href of the querystring in software.asp is What i would like to see but i cant is:HOMESUPPORTSOFTWAREHARDWAREWindowsXPWindows2000Windows98Windows95ziprarisoSo how to do the querystring or set the href of every sub querystring that the data of previous and this one would be still there and i could open all sub "data" - some kind of menu , submenu , subsubmenu,...Thank you for hel i hope u understand

  9. You can also add a "Case Else" to the switch statement which will get executed if none of the other cases match.
    HelloThanks for that! But a few minutes ago i just did it like this.Value = 0 Then Value ""If Value <> "" Then Run = 1...Select Case RunCase 1SQL = SELECT * FROM tblCompany WHERE Cost = " & Value & " ;"By using <> i can writte all the combinations that i want ,...Thanks
  10. Hello , let mi first try to show you what i am trying to do.

    date1 = Request.Form("date1")date2 = Request.Form("date2")date = Request.Form("date")value1 = Request.Form("value1")value2 = Request.Form("value2")company = Request.Form("company")If date ="" and value1 = "" and value2 = "" and company = ""   and date2="" and date1 ="" Then checking = 1  End IfIf date ="1" and value1 = "" and value2 = "" and company = "" and date1 ="" And date2=""  Then checking = 3 End IfIf  date ="2" and value1 = "" and value2 = "" and company = "" and date1 ="" And date2="" Then checking = 4 End IfIf  date ="3" and value1 = "" and value2 = "" and company = "" and date1 ="" And date2="" Then checking = 5  End IfIf date = "4" and value1 = "" and value2 = "" and company = "" and date1 ="" And date2="" Then checking = 6 End IfIf value1 = "" and value2 = "" and date1 ="" And date2="" Then checking = 7 End IfIf  company = "" and value2 = "" and date1 ="" And date2="" Then checking = 8 End IfIf  value1 = "" and company = "" and date1 ="" And date2="" Then checking = 9 End IfIf  value2 = "" and value1 = "" and company = ""  And date2="" Then checking = 10 End IfIf  date1="" and value2 = "" and value1 = "" and company = "" Then checking = 11 End If...'as you can see i am trying to write all the combinations to make a search without an error. But i have a problem with writting this if statementSelect Case checking   Case 1	sql = "SELECT * FROM tblcompany;"	   Case 2	sql = "SELECT * FROM tblcompany WHERE company_date BETWEEN "&(date1)&" AND " &(date2)&";"   Case 3  	sql = "SELECT * FROM tblcompany WHERE company_date BETWEEN "&fncleto(a)&" AND "&fncdanes(b)&" ;"   Case 4   	sql = "SELECT * FROM tblcompany WHERE company_date BETWEEN "&fncmesec(c)&" AND "&fncdanes(b)&";"	   Case 5   	sql = "SELECT * FROM tblcompany WHERE company_date BETWEEN "&fncteden(d)&" AND "&fncdanes(b)&";"	   Case 6  	sql = "SELECT * FROM tblcompany WHERE company_date = "&fncdanes(b)&" ;"	   Case 7     sql = "SELECT * FROM tblcompany WHERE company = " &company&";"     Case 8  	sql = "SELECT * FROM tblcompany WHERE company_value >= " &value1&";" 	   Case 9  	sql = "SELECT * FROM tblcompany WHERE company_value <= " &value2& ";"   Case 10     sql = "SELECT * FROM tblcompany WHERE company_date >= "&date1&";"   Case 11     sql = "SELECT * FROM tblcompany WHERE company_date <= "&date2&";"     Case 12     sql = "SELECT tblcompany.company, tblcompany.company_value FROM tblcompany WHERE (((tblcompany.company)='" & company & "') AND ((tblcompany.company_value)='" & value1 & "'));"  ...	End Select

    O.K. I have a problem with writting a corect If statement, ... Why this kind of statement, i would like to writte all of the combinations of atributs so that i would never get an eror and allways an corect SELECT would be made. For example: when nothing is chouse i get he table with all the data , and so on. I eaven would like to filtet with more combinations. This will be a filter for data that i get from the DB. date is an radiobutton,... i think that you will figer it out, but this still aren t all the combinations that i wrot , this is just a part of it,...Can someon help me with this IF statementThanks

  11. Hello,Anyone has an colum sortable table code. I have created conection to DB an i get data in a table. But now i would like to install some JAVASCRIPT with more advance filtering by rows , sum , sorting by rows and limitation of number of rows per page. I am working with ASP. If not mabe just a code for limitation of number of rows per page with next an prewious link to go trought data. And code for sum one of the coloum with footer row where the sum is.The best would be one advanced javascript for tables. I only found the basic one. I dont have a clue about scripting in this language, so please , help me.Regards

  12. Hello,Can someone help me with this code , i tried to create an filter that if a check box is checked the select case would test one sql select and if not would do the other one. I was checking what i get (response.write sqlresponse.end ) , the only result that i get was when if ch1 = "" was like this ufcourse the forum is not written in full version. What am i doing wrong , mabe someone can repair my code. Thank you

    response.write("<tr><td><input type='checkbox' name='ch1'></td></tr>")ch1 = Request.Form("ch1")If ch1 ="1"  then test= 1 else test = 2 end ifSelect Case test  Case 1	sql = "SELECT * FROM tblxx;" Case 2  	sql = "SELECT * FROM tblxx WHERE O xx_date BETWEEN " & fncleto(a) & " AND " & fncdanes(b) & " ;"End Select

  13. Can somebody else help me with this one? This is the whole code,..., i din t translate it, but u will understand it. If you look at first post you will see what i am trying to do. The problem is check box because it doesent gives me the result but send me an error. If i remove the code of a check box and SELECT statement of it the code work,... , but now gives me an error written two post up.

    <%'funkcija, ki poskrbi za urejanje tekstaFunction uredi(tekst,akcija)		'če je akcija 1 potem vpisujemo v bazo, drugače pa beremo iz nje	if akcija = 1 then	  'preberemo podatke iz baze (zamenjamo odstavke z <br>)  uredi = Replace(tekst,"<BR>",Chr(13)+Chr(10))  's tem delom poskrbimo, da vse enojne narekovaje zamenjamo  'z AAA, ki jih potem pri branju iz baze pretvorimo nazaj v narekovaj  uredi = Replace(uredi,"'","AAA")		else	  If Not IsNull(tekst) Then 	 'preberemo podatke iz baze (zamenjamo odstavke z <br>) 	 uredi = Replace(tekst,"<BR>",Chr(13)+Chr(10)) 	 uredi = Replace(uredi,"AAA","'")	  Else 	 'če ni teksta za urediti vrnemo prazen string 	 uredi=""  End If		end if	End Function'deklaracija spremenljivkDim SQL, conn, rs %><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("_db/popravila.mdb"))set rs=Server.CreateObject("ADODB.recordset")sql="SELECT DISTINCT Naziv FROM tblPopravljeno ORDER BY Naziv"rs.Open sql,connnaziv=request.form("naziv1")%><form method="post"><input type=text name="naziv1" value="Hermes d.o.o. "><input type="submit" /><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("_db/popravila.mdb"))set rs=Server.CreateObject("ADODB.recordset")sql="SELECT DISTINCT Naprava FROM tblPopravljeno ORDER BY Naprava"rs.Open sql,connnaprava=request.form("naprava1")%><select name="naprava1"><%  do until rs.EOF    response.write("<option")    if rs.fields("naprava")=naprava then      response.write(" selected")    end if    response.write(">")    response.write(rs.fields("naprava"))    rs.MoveNextlooprs.Closeset rs=Nothing %></select><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("_db/popravila.mdb"))set rs=Server.CreateObject("ADODB.recordset")sql="SELECT DISTINCT Popravljeno FROM tblPopravljeno"rs.Open sql,connpopravljeno=request.form("popravljeno")%><input type="checkbox" name="popravljeno" checked/></form><%if naziv<>"" & naprava<>"" & popravljeno<>""  thenDim n'SQL stavek, ki nam prikaže popravilaSQL="SELECT * FROM tblPopravljeno WHERE naziv = '" & naziv & "' AND naprava = '" & naprava & "'  AND popravljeno = '" & popravljeno & "'  "'odpremo tabelo z SQL stavkomSet rs = conn.execute(SQL)'če baza ni praznaif not rs.EOF then%><tr class="text_0"><td><b>Št. naloga</b></td><td><b>Naprava</b></td><td><b>Oznaka naprave</b></td><td><b>Datum prevzema</b></td></tr><tr><td> </td></tr><%'zanka za prikaz vseh novicn = 1do%><tr><!-- povezava na urejanje novice --><td><a href="?sub=edt&id=<%=rs("Popravljeno_ID")%>" class="link_1" style=" text-decoration:none"><b><%=uredi(rs("popravljeno_ID"),0)%></b></a></td><td align="left" class="text_1"><%=uredi(rs("naprava"),0)%></td><td align="center" class="text_1"><%=uredi(rs("oznaka_naprave"),0)%></td><td align="center" class="text_1"><%=uredi(rs("datum_prevzema"),0)%></td><!-- povezava za brisanje vnosa --><td><a href="?sub=edt&id=<%=rs("Popravljeno_ID")%>" class="link_1">Uredi/</a></td><!-- povezava za brisanje vnosa --><td class="text_1"><a href="?sub=del&id=<%=rs("Popravljeno_ID")%>" class="text_1">Briši</a></td></tr><tr><td colspan="6"><hr noshade size="1" color="#cccccc"></td></tr><%n = n + 1rs.MoveNextLoop until rs.EOFEnd if%>	<%End if%>

  14. Hello,I have a problem with making a query by using a radio button and check box. For example,...

    <%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("_db/1.mdb"))set rs=Server.CreateObject("ADODB.recordset")sql="SELECT DISTINCT XXX FROM tblXXX"rs.Open sql,connXXX=request.form("XXX")%><form method="post"><input type=checkbox name="XXX" checked><input type="submit" /><%if XXX<>""   thenDim nSQL="SELECT * FROM tblXXX WHERE XXX = '" & XXX & "'  "Set rs = conn.execute(SQL)if not rs.EOF then%>..... Now folows the data that i should get,...

    O.K. When i use this code with textbox or select box works prfectly , but now i am trying to make some parameters which includes radio butten and check box as well. And when i am trying to get the data from that code i get error:Technical Information (for support personnel)Error Type:Microsoft JET Database Engine (0x80040E07)Data type mismatch in criteria expression./hermesPOPRAVILO.asp, line 13Browser Type:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322) Page:POST 63 bytes to /19833266_POPRAVILO_HERMES.aspPOST Data:naziv1=Hermes+d.o.o.&naprava1=Osnovna+plo%9A%E8a&popravljeno=on Time:5. junij 2006, 13:34:52 More information:Microsoft Support Can anyone help what i am doing wrong,...,thanks!Regards,K

  15. ?company=F&Gjust put & after the & to be and remember the to end witha semicolon

    Hello,Eaven if i put & between the letters , the problem stays the same, if i look at querystrin it stays like this ?company=F&G, but i don t get any data from selected company,...... any othe suggestions?Thanks,K
  16. Hello,I have a problem with symbol &. When i would like to read from db some name of a company for example F&G , i dont get the result , probably becouse of this &. I tried to replace it with html symbol number & but ther is no succes! I am doing a selection by using QueryString ?company=F&GIf i delete & everything works fine, how could i solve this kind of problem?ThanksK

  17. Hey Vin or someone else,Can i ask you one more question about this code?I would like to to , that at the star of this code , before the country is selected, a data from tbl in this DB would be written, and after selection , this data would disapear , and data about selected country would be writen. I inserted som query.string, but , it doesn t work at all   Now only the included file is shown and after selection nothing happens , the included file data is still there....my code[codebox]<%'------------------------------------'These Variables'------------------------------------selectWidth = 200    'width of select box in pixelsselectHeight = 200    'height of select box in pixelsselectAlpha = 80     'transparency of drop-down listselectBackgroundColor = "#00FF00"    'Background colour of drop down listselectHighlightColor = "#FF0000"     'background colour of option when mouse overselectTextHighlightColor = "#FFF"    'text colour of option when mouse over%><script language="javascript">function showHide(){//  if(document.getElementById('mySelectBox').style.visibility=="hidden"){//   document.getElementById('mySelectBox').style.visibility='visible';//  }else{//   document.getElementById('mySelectBox').style.visibility='hidden';//  }}function move_up() {//   scroll_clipper.scrollTop = 0;}</script><style>input{border:none;cursor:pointer;width:100%;padding:2;background-color:transparent;}#customSelect{border:1px solid #c0c0c0;cursor:pointer;}</style><body bgcolor=#33CC33><form name="myForm" method=post><div style="position: absolute;  z-index: 1" id="layer1"><div style="position: absolute;  z-index: 1; visibility:visible" id="mySelectBox"><div id='scroll_clipper' style='filter:alpha(opacity=<%=selectAlpha%>);position:absolute; width:<%=selectWidth%>px; height: <%=selectHeight%>px; overflow-y:auto'>   <div id='scroll_text' style="background-color:<%=selectBackgroundColor%>;">      <table border="0" cellspacing=0 cellpadding=0 width="100%" id="table1"><%'------------------------------'DSN'------------------------------set conn=server.createobject("ADODB.CONNECTION")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("/db/northwind.mdb"))'------------------------------'Get data..'------------------------------set rs = conn.execute("SELECT DISTINCT Country FROM Customers ORDER BY Country")  while not rs.eof Country = trim(rs(0))  %>          <tr onclick="document.myForm.country.value='<%=Country%>';move_up();showHide();myForm.submit();" style="cursor:pointer;" color="#FFFFFF" onmouseout="this.bgColor='';this.style.color = '';" onmouseover="this.bgColor='<%=selectHighlightColor%>';this.style.color='<%=selectTextHighlightColor%>';">             <td style="padding:0 0 1 2;"><%=Country%></td>          </tr>  <%rs.movenext wEnd%>      </table>    </div></div></div><input type="hidden" name="country" value="<%=trim(request("country"))%>" readonly /></div></form><%If Request.QueryString("country") = "" then %><!--#include file=thisiswhatiwouldliketogetbeforeselection.asp--><%else%><%country = trim(request("country"))if country<>"" thensql="SELECT Customers FROM Customers WHERE country='" & country & "'" & Request.QueryString("Country") & "'"set rs=Server.CreateObject("ADODB.Recordset")rs.Open sql,conn%><table width="100%" cellspacing="0" cellpadding="2" border="1"><tr><th>Customers</th></tr><% do until rs.EOF  response.write("<tr>")  response.write("<td>" & rs.fields("Customers") & "</td>")  response.write("</tr>") rs.MoveNext loop%></table><% end if %><%'------------------------------'Close conn..'------------------------------ rs.closeset rs = nothing conn.closeset conn = nothing%><% end if %></body></html>[/codebox]

  18. <%country = trim(request("country"))if country<>"" thensql="SELECT Customers FROM Customers WHERE country='" & country & "'"set rs=Server.CreateObject("ADODB.Recordset")rs.Open sql,conn%><table width="100%" cellspacing="0" cellpadding="2" border="1"><tr><th>Customers</th></tr><% do until rs.EOF  response.write("<tr>")  response.write("<td>" & rs.fields("Customers") & "</td>")  response.write("</tr>") rs.MoveNext loop%></table><% end if %>

    O.K. this is my example, what i would like to do is that if, ther is no selection in this IF i would like to make ELSE , that would select data from other table in DB

    country = trim(request("country"))if country<>"" thensql="SELECT Customers FROM Customers WHERE country='" & country & "'"set rs=Server.CreateObject("ADODB.Recordset")rs.Open sql,conn%><table width="100%" cellspacing="0" cellpadding="2" border="1"><tr><th>Customers</th></tr><% do until rs.EOF  response.write("<tr>")  response.write("<td>" & rs.fields("Customers") & "</td>")  response.write("</tr>") rs.MoveNext loop%><%elsesql="SELECT Distributors FROM Distributors WHERE country='" & country & "'"set rs=Server.CreateObject("ADODB.Recordset")rs.Open sql,conn%><table width="100%" cellspacing="0" cellpadding="2" border="1"><tr><th>Distributors</th></tr><% do until rs.EOF  response.write("<tr>")  response.write("<td>" & rs.fields("Distributors") & "</td>")  response.write("</tr>") rs.MoveNext loop%></table><% end if %>

    I made it like this , but no luck, it doesn t wor at all!!! So what do i need to repair?Thanks

  19. O.K. thanks, but how do i tell the page where my form is to send it over this code. I have found bunch of this codes , where only xode for sendmail is , but newer how to set form. When i use this codes , nothing happens,... So how set the par with form if you have code like this:

    <%Dim sMsg Dim sTo Dim sFrom Dim sSubject Dim sTextBody sTo = "recipient@maildomain.com"sFrom = "fromaddress@maildomain.com"sSubject = "Insert here your subject text"sTextBody = "Insert here your plain body text"Dim objMail'Create the mail object Set objMail = Server.CreateObject("CDO.Message")'Set key properties objMail.From = sFrom objMail.To = sTo objMail.Subject= sSubject objMail.TextBody = sTextBody 'Send the email objMail.Send 'Clean-up mail objectSet objMail = Nothing%>

    Thanks

×
×
  • Create New...