|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
SitePoint Enthusiast
![]() Join Date: Sep 2004
Location: kl
Posts: 42
|
too few parameters
I have no idea where was I wrong. This is my coding...
<%@ language="VBScript" %> <% Option Explicit %> <% Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adCmdText = &H0001 Dim strURL, strSearch strURL = Request.ServerVariables("URL") strSearch = Request.QueryString("nama") strSearch = Replace(strSearch, "'", "''") %> <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>Sistem Pinjaman Peralatan & Perisian - Pengesahan Pinjaman</title> </head> <body bgcolor="#FFE6FF"> <table border="0" width="100%" height="41"> <tr> <td width="5%" height="37"> <p align="center"></td> <td width="15%" height="37"> <p align="right"><img border="0" src="images/mpsp_logo.jpg"></td> <td width="80%" height="37"><font color="#8A3871"><!--webbot bot="Ws3FpEx" startspan clientside moduleid="'sistem pinjaman (Project)\banner.xws'" PREVIEW="<img src='images/banner.gif?01685B6B' editor='Webstyle3' border='0'>" --><img src="images/banner.gif?01685B6B" editor="Webstyle3" border="0"><!--webbot bot="Ws3FpEx" i-CheckSum="36575" endspan --> </font></td> </tr> </table> <p align="center"> <!--webbot clientside bot="Ws3FpEx" moduleid="'sistem pinjaman (Project)\divider.xws'" PREVIEW="<img src='images/divider.gif?00F35C30' editor='Webstyle3' border='0'>" startspan --><img src="images/divider.gif?00F35C30" editor="Webstyle3" border="0"><!--webbot bot="Ws3FpEx" i-CheckSum="51209" endspan --></p> <table border="0" width="100%"> <tr> <td width="100%"> <p align="center"><b><font color="#8A3871">Masukkan nama anda untuk melihat status permohonan.</font></b></p> <form method="GET" action="<%= strURL %>"> <p align="center"><font color="#8A3871"><b>Nama : </b></font> <input type="text" name="nama" size="27"></p> <% If strSearch <> "" Then Dim Conn, Rs, sSQL, RsCount Set Conn = Server.CreateObject("ADODB.Connection") Set Rs = Server.CreateObject("ADODB.Recordset") Conn.open "DRIVER=Microsoft Access Driver (*.mdb); DBQ="& Server.MapPath("sistem.mdb") sSQL = "SELECT * " _ & "FROM mohon " _ & "WHERE pemohon LIKE " & Replace(strSearch, "'", "''") & " " _ & "AND status = ON " _ & "ORDER BY Bil DESC;" Rs.Open sSQL, Conn, adOpenStatic, adLockReadOnly, adCmdText RsCount = Rs.RecordCount If RsCount = 0 Then %> <hr> <table border="0" width="100%"> <tr> <td width="15%"></td> <td width="70%"> <p align="center"><b><font color="#8A3871">Pastikan anda menulis nama yang betul.</font></b></p> <p align="center"><b><font color="#8A3871">Nama yang anda telah tulis tiada dalam rekod permohonan.</font></b></p> <% Else If Rs.lulus = "Lulus" Then Response.write "<p align='center'><b>Permohonan anda diluluskan.</b></p>" Else Response.write "<p align='center'><b>Permohonan anda tidak diluluskan.</b></p>" Response.write "<p align='center'><b>" & Rs("catatan") & "</b></p>" End If %> <table border="1" width="100%" height="150"> <tr> <td width="50%" height="19" align="center"><b><font color="#8A3871">Nama pemohon</font></b></td> <td width="50%" height="19"> <%= Rs.Fields("pemohon").Value %></td> </tr> <tr> <td width="50%" height="19" align="center"><b><font color="#8A3871">Peralatan yang dimohon</font></b></td> <td width="50%" height="19"> <%= Rs.Fields("peralatan").Value %></td> </tr> <tr> <td width="50%" height="19" align="center"><b><font color="#8A3871">Tarikh peminjaman</font></b></td> <td width="50%" height="19"> <%= Rs.Fields("trpinjam").Value %></td> </tr> <tr> <td width="50%" height="19" align="center"><b><font color="#8A3871">Tarikh pemulangan</font></b></td> <td width="50%" height="19"> <%= Rs.Fields("trpulang").Value %></td> </tr> <tr> <td width="50%" height="16" align="center"><b><font color="#8A3871">Catatan</font></b></td> <td width="50%" height="16"> <%= Rs.Fields("catatan").Value %></td> </tr> </table> </td> <td width="15%"></td> </tr> </table> </form> </td> </tr> </table> <% End If %> <% End If %> </body> </html> I have post this in other forums but it failed to help me. I hope someone here would reply the conclusion. this page only have 1 textbox to user give input & press enter. then the error appear too few parameter expected 1. |
|
|
|
|
|
#2 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Sep 2004
Location: secunderabad
Posts: 273
|
do you have to replace this with the input variable :
& "WHERE pemohon LIKE " & Replace(strSearch, "'", "''") & " " _ & "AND status = ON " _ where I believe strSearch should be replaced by the actual value. Its not taking the parameter, if I am right!! Regards |
|
|
|
|
|
#3 |
|
Original Gangster
![]() ![]() ![]() Join Date: Oct 2000
Location: Jackson, NJ
Posts: 4,713
|
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 15:50.











Hybrid Mode
