Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need Code Please

Posted on 2000-04-06
4
Medium Priority
?
631 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 18

Accepted Solution

by:
mgfranz earned 276 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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 will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

721 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