Solved

Need Code Please

Posted on 2000-04-06
4
627 Views
Last Modified: 2009-12-16
1st>
Sorry, all I have is 69 points..

2nd>
I have an Access mdb with 2 fields
sFileName       text type
sFileDisplay    memo type

I know how to access the database...what I need is
a form with an input box and an sql that will search
throught the sFileNames and find all occurances of the
user's input.

ie.  userinput = textbox

sql finds all occuraces of text or box or any sequencial
combo of the text..ie...extb or tbo or text or box etc.

I then want the sFileNames returned to 1 column of a table
and then the words "View Code" send to the 2nd column with
the words "View Code" hyperlinked to the field sFileDisplay.

I want the sFileDisplay field to display as it is entered...

eg. below:
================================================================
'to read the computer name and registered name of owner.

'  Set A Reference to the "Windows Scripting Host Object Model"
'  copy and paste the following:

Private Sub Command1_Click()

Dim wshShell As New IWshShell_Class
Dim strComputerName As String

strComputerName = wshShell.RegRead _
   ("HKEY_LOCAL_MACHINE\" _
   & "System\" _
   & "CurrentControlSet\" _
   & "Control\" _
   & "ComputerName\" _
   & "ComputerName\" _
   & "ComputerName")

wshShell.RegWrite _
   "HKEY_LOCAL_MACHINE\" _
   & "System\" _
   & "CurrentControlSet\" _
   & "Control\" _
   & "ComputerName\" _
   & "ComputerName\" _
   & "ComputerName" _
   , strComputerName

 MsgBox (wshShell.RegRead _
   ("HKEY_LOCAL_MACHINE\" _
   & "System\" _
   & "CurrentControlSet\" _
   & "Control\" _
   & "ComputerName\" _
   & "ComputerName\" _
   & "ComputerName"))
End Sub

Private Sub Command2_Click()
Dim wshShell As New IWshShell_Class
Dim strWorkGroup As String

strWorkGroup = wshShell.RegRead _
   ("HKEY_LOCAL_MACHINE\" _
   & "System\" _
   & "CurrentControlSet\" _
   & "Services\" _
   & "Vxd\" _
   & "VnetSup\" _
   & "WorkGroup")

wshShell.RegWrite _
   "HKEY_LOCAL_MACHINE\" _
   & "System\" _
   & "CurrentControlSet\" _
   & "Services\" _
   & "Vxd\" _
   & "VnetSup\" _
   & "WorkGroup" _
   , strWorkGroup

MsgBox (wshShell.RegRead _
   ("HKEY_LOCAL_MACHINE\" _
   & "System\" _
   & "CurrentControlSet\" _
   & "Services\" _
   & "Vxd\" _
   & "VnetSup\" _
   & "WorkGroup"))
End Sub

Thanks
0
Comment
Question by:Juilette
  • 3
4 Comments
 
LVL 18

Accepted Solution

by:
mgfranz earned 69 total points
ID: 2691941
Sure easy.  Try this;

// Form.htm

<form method=get action=getit.asp>
Enter Your select string: <input type="text" name="GetText"><br>
<input type="submit" name="submit" value="Submit">
<input type="Reset">
</form>

On the getit.asp page;

<%
' Make your dB connection and open therecordset here, I am showing a DNS-less conection for simplicity

Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionTimeout = 15
conn.CommandTimeout =  10
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("../data/test1.mdb")
Set rs = Server.CreateObject("ADODB.Recordset")

%>

This is what we found as a match<br>

<%
sFile = Request.Form("GetText")
SQL = "SELECT sFileName, sFileDisplay FROM Table WHERE sFileName ='%"& (sFile) &"%'"
rs.Open SQL, conn, 2, 1
%>
<%
If Not rs.eof Then
%>
<table>
<tr bgcolor="#cbcb96">
<td align="left" align="center">sFileName</td>
<td  align="left" align="center">sFileDisplay</td>
</tr>
<%
On Error Resume Next
rs.MoveFirst
do while Not rs.eof
 %>
<tr valign="top">
<td valign="baseline" width=75>&nbsp;<a href=wine.asp?field=<%=Server.HTMLEncode(rs.Fields("sFileName").Value)%>><%=Server.HTMLEncode(rs.Fields("sFileName").Value)%></a></td>
<td width=65 valign="baseline">
<%= Server.HTMLEncode(rs.Fields("sFileDisplay").Value)%></td>
</tr>
</table>
</html>

You know the drill... clean-up and table layout...

Mark
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2691947
I forgot to close the loop...

Here is the closing table tag and the loop call;

<%
rs.MoveNext
loop
%>
</table>

Also in the href tag you place whatever .asp file or htm file you need... ;-)
0
 
LVL 4

Author Comment

by:Juilette
ID: 2692793
I'll give you the points now and I'll check it later...plese stay attached for a day or so in case I need a little push.

Thanks
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2693483
No problem, I'm not going anywhere... ;-)
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now