Solved

Need Code Please

Posted on 2000-04-06
4
625 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

21 Experts available now in Live!

Get 1:1 Help Now