Jump to content

pulpfiction

Members
  • Posts

    1,210
  • Joined

  • Last visited

Posts posted by pulpfiction

  1. I guess you want to select 7 days result from the today's date. try thisstrMySQL = "select * from tb_PC Where ((DATEDIFF(d, dtMakePayment, GETDATE()) <= 7) ORDER BY dtMakePayment

  2. The Error message,Parser Error Message: Could not load type 'IntranetTamanLaut.Global'That must be the rootnamespace followed by the class name of the .vb file, jus check if both match (rootnamespace.vbclassname)

  3. Hi,That wont work cos when you use an aggregate function on a field then that field must be included in the GROUP BY.Try this....sqlCommand = ""sqlCommand = sqlCommand + "SELECT SUM[Quantity], [supp-product], [Customer] "sqlCommand = sqlCommand + "FROM y2005m05 "sqlCommand = sqlCommand + "WHERE [supp-product]='VIT701380' AND [Customer]='B001K' "sqlCommand = sqlCommand + "GROUP BY [Quantity],[supp-product], [Customer] "

  4. Hi, you have to check the datatype for the field in the DB in which you will insert the value from the form..In general it s going to be like this<input type="radio" name = "test" value = "1"> The value from the VALUE attribute will be got when you do a POST. So make sure that the value and the datatype in the DB match.HTH

  5. try this code. check out the code below (your code with small changes marked in bold)<html><body><center><table width="30%" cellspacing="0" cellpadding="2" border="1" ><tr><th bgcolor = "yellow">name</th><th bgcolor = "yellow">age</th><th bgcolor = "yellow">address</th></tr><%Dim conn Dim rs Set Conn = Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("/webdata/it.mdb"))set rs = Server.CreateObject("ADODB.recordset") sql= "SELECT * FROM samer WHERE user = '" & Request.Form("name") & "'"set RS = Conn.Execute(SQL)IF NOT RS.EOF THENresponse.write("<td>" & rs.fields("name") & "</td>") & "<BR>"response.write("<td>" & rs.fields("age") & "</td>") & "<BR>"response.write("<td>" & rs.fields("address") & "</td>") & "<BR>"RS.MoveNextLoopELSEResponse.Redirect "loginFalied.asp"END IFRS.CloseSet RS = nothingConn.CloseSet Conn = nothing%></center></body></html>

  6. Hi, I dont see if you are using the [DATE] in the SELECT statement anywhere in the code, so if you can write the SELECT without [DATE] field it could be much easier.One more thing should the WHERE come ahead of the GROUP BY (i am not pretty sure abt that in MS Access, but i guess that how it works in sql server) Try this....SELECT artist, count(artist) AS artist_countFROM song WHERE [date] > " & DateAdd("ww", -1, Date) & " GROUP BY artistORDER BY artist_count DESCHTH

  7. Hi guys and girls from having learned a lot from W3Schools I came across a problem which even the site doesn't explain so came to the forums for some guidance. Having searched Google hard I found no luck in resolving this problem. I would like to group my fields together according to an expression. Now this seems easy... yes it does as W3Schools tutorials suggest however I am using ASP and embedding SQL into limiting the data produced via this SQL Statement:
    dim sqlCommand		sqlCommand = ""	sqlCommand = sqlCommand + "SELECT [B][Quantity], [Supplier][/B] "	sqlCommand = sqlCommand + "FROM y2005m05 "	sqlCommand = sqlCommand + "GROUP BY [Quantity] "		objRs.open sqlCommand, objconn,1,3

    However after running it I get this:Error Type:Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)[Microsoft][ODBC SQL Server Driver]

    Column 'y2005m05.Supplier' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause./test_pro2/groupbysupp.asp, line 60[/b]Suggestions and Comments are welcome. Thank youPent  

    [right][post=14498]<{POST_SNAPBACK}>[/post][/right]

    The fields that you get in the SELECT statement must be a part of the group by. like this sqlCommand = ""sqlCommand = sqlCommand + "SELECT [b][Quantity], [supplier] [/b]"sqlCommand = sqlCommand + "FROM y2005m05 "sqlCommand = sqlCommand + "GROUP BY [b][Quantity],[supplier][/b] "If you have somthing in the SELECT it should be in the GROUP BY too.HTH
  8. you can check it in two steps, is this what you are looking for?dim val'checks if atleast 1 record is presentif rs.RecordCount = 0 Then Response.Write " No Record Present" End If IF NOT RS.EOF THENval = RS("sv_no")END IF'to check if supervisor number is nullIF (Len(val) = 0) OR (IsNull(val)) THENresponse.write "Error: supervisor_no is NULL"END IF

  9. Is this what you are looking for..,ASP:<% dim uname, pwd,sqluname=request.form("login")pwd=request.form("pass")'Query to check if username and pwd vaildsql = "SELECT * FROM tblname WHERE (fldUSERNAME ='" & uname & "') AND (fldUSERNAME ='" & pwd & "')"Set RS = MyConn.Execute(SQL)if rs.EOF then'Invalid userElse'valid user...... %>HTML:<form action="test.asp" method="post"><inupt name="login"...........><inupt name="pass"...........>

  10. (vs 2003/ asp.net/vb)i am getting the datefld from the table (sql server) and the field type is "small date time" in the table the field looks like "10/26/2003"but displays like this in the datagrid,10/26/2003 12:00:00 AMi want it to display jus the date. Help!!!Thank you.

  11. if you want different color for each cell, then i guess CSS will not help, you can change the color of the cell by <td bgcolor="colorname">Part of the code.....<td bgcolor="gray" onmouseover="showmenu('tutorials')" onmouseout="hidemenu('tutorials')"> <a href="/default.asp">Tutorials</a><br /><table class="menu" id="tutorials" width="120"> <tr><td bgcolor="red"><a href="/html/default.asp">HTML</a></td></tr> <tr><td bgcolor="green"><a href="/xhtml/default.asp">XHTML</a></td></tr> <tr><td bgcolor="white"><a href="/css/default.asp">CSS</a></td></tr> <tr><td bgcolor="cyan"><a href="/xml/default.asp">XML</a></td></tr> <tr><td bgcolor="pink"><a href="/xsl/default.asp">XSL</a></td></tr> </table>

  12. You mean somthing like this

    <html><head><style>body{font-family:arial;}table{font-size:80%;background:black}a{color:black;text-decoration:none;font:bold}a:hover{color:#606060}td.menu1{background:red}td.menu2{background:blue}td.menu3{background:green}table.menu{font-size:100%;position:absolute;visibility:hidden;}</style><script type="text/javascript">function showmenu(elmnt){document.getElementById(elmnt).style.visibility="visible"}function hidemenu(elmnt){document.getElementById(elmnt).style.visibility="hidden"}</script></head><body><h3>Drop down menu</h3><table width="100%"><tr bgcolor="RED"> <td onmouseover="showmenu('tutorials')" onmouseout="hidemenu('tutorials')">  <a href="/default.asp">Tutorials</a><br />  <table class="menu" id="tutorials" width="120">  <tr><td class="menu1"><a href="/html/default.asp">HTML</a></td></tr>  <tr><td class="menu2"><a href="/xhtml/default.asp">XHTML</a></td></tr>  <tr><td class="menu3"><a href="/css/default.asp">CSS</a></td></tr>  </table> </td> <td onmouseover="showmenu('scripting')" onmouseout="hidemenu('scripting')" bgcolor="blue">  <a href="/default.asp">Scripting</a><br />  <table class="menu" id="scripting" width="120">  <tr><td class="menu1"><a href="/js/default.asp">JavaScript</a></td></tr>  <tr><td class="menu2"><a href="/vbscript/default.asp">VBScript</a></td></tr>  <tr><td class="menu3"><a href="default.asp">DHTML</a></td></tr>  </table> </td> <td onmouseover="showmenu('validation')" onmouseout="hidemenu('validation')" bgcolor="green">  <a href="/site/site_validate.asp">Validation</a><br />  <table class="menu" id="validation" width="120">  <tr><td class="menu1"><a href="/site/site_validate.asp">Validate HTML</a></td></tr>  <tr><td class="menu2"><a href="/site/site_validate.asp">Validate XHTML</a></td></tr>  <tr><td class="menu3"><a href="/site/site_validate.asp">Validate CSS</a></td></tr>    </table> </td></tr></table><p>Mouse over these options to see the drop down menus</p></body></html>

  13. To check if the username already exists....SQL = "SELECT fldUSERNAME FROM TBL WHERE fldUSERNAME='" & request.Form("Username") & "'Set RS = Server.CreateObject("ADODB.Recordset")RS.Open SQL, MyConn IF NOT RS.recordcount <=0 THENErrmsg="Username Already Exists"END IF

  14. Hi why is that you need HTML or JS, dont want to use CSS?this is how its done in css. it will work for all pages.a:hover { color: #F5F5F5; text-decoration: underline;}

  15. I guess this is what u wanted. try the code below...

    <html><head><style>body{font-family:arial;}table{font-size:80%;background:black}a{color:black;text-decoration:none;font:bold}a:hover{color:#606060}td.menu1{background:red}td.menu2{background:blue}td.menu3{background:green}table.menu{font-size:100%;position:absolute;visibility:hidden;}</style><script type="text/javascript">function showmenu(elmnt){document.getElementById(elmnt).style.visibility="visible"}function hidemenu(elmnt){document.getElementById(elmnt).style.visibility="hidden"}</script></head><body><h3>Drop down menu</h3><table width="100%"> <tr bgcolor="RED">  <td onmouseover="showmenu('tutorials')" onmouseout="hidemenu('tutorials')">   <a href="/default.asp">Tutorials</a><br />   <table class="menu" id="tutorials" width="120">   <tr><td class="menu1"><a href="/html/default.asp">HTML</a></td></tr>   <tr><td class="menu1"><a href="/xhtml/default.asp">XHTML</a></td></tr>   <tr><td class="menu1"><a href="/css/default.asp">CSS</a></td></tr>   <tr><td class="menu1"><a href="/xml/default.asp">XML</a></td></tr>   <tr><td class="menu1"><a href="/xsl/default.asp">XSL</a></td></tr>   </table>  </td>  <td onmouseover="showmenu('scripting')" onmouseout="hidemenu('scripting')" bgcolor="blue">   <a href="/default.asp">Scripting</a><br />   <table class="menu" id="scripting" width="120">   <tr><td class="menu2"><a href="/js/default.asp">JavaScript</a></td></tr>   <tr><td class="menu2"><a href="/vbscript/default.asp">VBScript</a></td></tr>   <tr><td class="menu2"><a href="default.asp">DHTML</a></td></tr>   <tr><td class="menu2"><a href="/asp/default.asp">ASP</a></td></tr>   <tr><td class="menu2"><a href="/ado/default.asp">ADO</a></td></tr>   </table>  </td>  <td onmouseover="showmenu('validation')" onmouseout="hidemenu('validation')" bgcolor="green">   <a href="/site/site_validate.asp">Validation</a><br />   <table class="menu" id="validation" width="120">   <tr><td class="menu3"><a href="/site/site_validate.asp">Validate HTML</a></td></tr>   <tr><td class="menu3"><a href="/site/site_validate.asp">Validate XHTML</a></td></tr>   <tr><td class="menu3"><a href="/site/site_validate.asp">Validate CSS</a></td></tr>   <tr><td class="menu3"><a href="/site/site_validate.asp">Validate XML</a></td></tr>   <tr><td class="menu3"><a href="/site/site_validate.asp">Validate WML</a></td></tr>   </table>  </td> </tr></table><p>Mouse over these options to see the drop down menus</p></body></html>

  16. i am not pretty sure about the XAMPP, but i think we have to save the file inside the folder C:\Program Files\XAMPP (as you said).but if you want to try EasyPHP. the after installation, say its in C:\Program Files\EasyPHP3.1, look for "www" folder. save the PHP files inside that folder. then you are good to go......

×
×
  • Create New...