Solved

Need Code Please

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 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