Hey all, am i wasting my time asking a classic ASP question on here?
IF not can someone please advise me how i can write code to look at my Forms input Text box, take what the user put in and then search my MS Access db and display the results. The user will only search for FirstName or LastName
I am using Dreamweaver CS4, ASP and MS Access
I know it must be possible to do this. Thx in advance
ps. please resist from advising me to use any other programms or code. Only reason im not using ASP . NET is becuase for some reason DW CS4 will not allow me to create a Dataset using Recordset. If i use classic ASP it then gives me the Recordset option.
Here's my code:
<%
Dim Recordset__ID
Recordset__ID = "1"
If (Request.Form("") <> "") Then
Recordset__ID = Request.Form("")
End If
%>
<%
Dim Recordset
Dim Recordset_cmd
Dim Recordset_numRows
Set Recordset_cmd = Server.CreateObject ("ADODB.Command")
Recordset_cmd.ActiveConnection = MM_Smit_STRING
Recordset_cmd.CommandText = "SELECT ?, FirstName, LastName, ext, cell FROM tel WHERE FirstName LIKE 'w%'"
Recordset_cmd.Prepared = true
Recordset_cmd.Parameters.Append Recordset_cmd.CreateParameter("param1", 200, 1, 255, Recordset__ID) ' adVarChar
Set Recordset = Recordset_cmd.Execute
Recordset_numRows = 0
%>
<%
set conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&_
Server.MapPath ("/database/smit.mdb") & ";"
set rs = conn.execute("SELECT = NULL")
if (RS.BOF and RS.EOF) then
response.write "No records found"
response.end
End if
%>
my Recordset fields:
<td height="30" align="left"><span class="p"><%=(Recordset.Fields.Item("FirstName").Value)%></span></td>
<td height="30" align="left"><span class="p"><%=(Recordset.Fields.Item("LastName").Value)%></span></td>
</tr>
<tr>
<td height="30" align="left"><span class="p"><%=(Recordset.Fields.Item("cell").Value)%></span></td>
<td height="30" align="left"><span class="p"><%=(Recordset.Fields.Item("ext").Value)%></span></td>
- <%
- Dim Recordset__ID
- Recordset__ID = "1"
- If (Request.Form("") <> "") Then
- Recordset__ID = Request.Form("")
- End If
- %>
- <%
- Dim Recordset
- Dim Recordset_cmd
- Dim Recordset_numRows
- Set Recordset_cmd = Server.CreateObject ("ADODB.Command")
- Recordset_cmd.ActiveConnection = MM_Smit_STRING
- Recordset_cmd.CommandText = "SELECT ?, FirstName, LastName, ext, cell FROM tel WHERE FirstName LIKE 'w%'"
- Recordset_cmd.Prepared = true
- Recordset_cmd.Parameters.Append Recordset_cmd.CreateParameter("param1", 200, 1, 255, Recordset__ID) ' adVarChar
- Set Recordset = Recordset_cmd.Execute
- Recordset_numRows = 0
- %>
- <%
- set conn = Server.CreateObject("ADODB.Connection")
- conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&_
- Server.MapPath ("/database/smit.mdb") & ";"
- set rs = conn.execute("SELECT = NULL")
- if (RS.BOF and RS.EOF) then
- response.write "No records found"
- response.end
- End if
- %>
- my Recordset fields:
- <td height="30" align="left"><span class="p"><%=(Recordset.Fields.Item("FirstName").Value)%></span></td>
- <td height="30" align="left"><span class="p"><%=(Recordset.Fields.Item("LastName").Value)%></span></td>
- </tr>
- <tr>
- <td height="30" align="left"><span class="p"><%=(Recordset.Fields.Item("cell").Value)%></span></td>
- <td height="30" align="left"><span class="p"><%=(Recordset.Fields.Item("ext").Value)%></span></td>