474,029 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display Search by Network (ex. Cisco) or All Projects in the MS Access Table

85 New Member
Hi All,

Below is a GOOD working script that I use to search for the record either by the MOP ID for example 1, 2, etc... (record on the database) or by Network for example when you type Cisco.

What I would like to do and is having problem is to either Search by Network or All MOP IDs on the database (show all records). Let's say if folks type in ALL, it will show all of the MOP IDs (Records) in the database. Thanks advance for your help.
Expand|Select|Wrap|Line Numbers
  1. <%
  2. Dim strNetwork
  3. Dim strMOPID
  4. Dim Conn
  5. Dim strSQL
  6. Dim RS
  7.  
  8. strNetwork = trim(Request.Form("Network"))
  9. strMOPID = trim(Request.Form("MOPID"))
  10. If len(strNetwork)=0 then
  11.     strNetwork=0
  12. End if
  13.  
  14. Set Conn = Server.CreateObject("ADODB.Connection")
  15. Set RS = Server.CreateObject("ADODB.Recordset")
  16.  
  17. Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("MOPsCentral.mdb")
  18.  
  19. If isNumeric(strNetwork) then
  20.     strSQL = "Select * FROM MOPs WHERE MOPID=" & strNetwork
  21. Else
  22.     strSQL = "Select * FROM MOPs WHERE Network='" & strNetwork & "' ORDER BY MOPID"
  23. End If
  24.  
  25. RS.Open strSQL, Conn
  26.  
  27. If RS.EOF Then
  28.    Response.Redirect("SearchMOPs.asp?MOPError=Sorry ... Your MOP ID or Network does not exist in our database.  Please try again.")
  29. End If
  30. %>
Jan 30 '08
10 1630
hotflash
85 New Member
Hi CroCrew,

Thanks for your oustanding support. I have sent you an email with 2 attachments.
Feb 4 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

8
20401
by: Vladimir | last post by:
Hello, I have a table in MS Access database. It has one field (with BYTE datatype) that has several properties set in Lookup tab of table Design View. Display Control = Combo Box. Row Source Type = Value List. Row Source = "1; "Above"; 2; "Below"; 3; "Equal"". When I try to SELECT <field> FROM <table> in my C++ application through ADO, I get numeric value of the field. How can I get string representation of this numeric value from the...
10
3342
by: nick_faye | last post by:
Hi guys, i'm still a newbie in using MS Access and in VB programming. I am using DAO connection from my VB to access the entries on my MS Access table. I am having trouble in editting and deleting entries from my table because it becomes slower and slower when my table is getting bigger and bigger. What I am doing right now is get the ID of the entry to be editted/deleted and I have to loop from first entry until I found the right ID...
2
2622
by: info | last post by:
I can successfully open a recordset based upon an Excel sheet in Access, but I can't work out how to copy all the records to an Access table. Any pointers?
12
7624
by: VMI | last post by:
For some reason, the process of retrieving data (about 20 records) from an Access table that has 400K records to a dataTable is taking over 3 mins. to complete. Below is my code to connect to the DB and query the table. The table "audit" primary key is "Line". Another weird thing (but I guess that's another post) is that, while it's doing the dataset Fill, my PC is slowed done substantially. But I don't know why that would happen since...
0
947
by: pnp | last post by:
Hi all, I would like to create a component that simulates the functionality of an MS Access table, through a Datagrid combined with comboboxes, datetime selectors and checkboxes. So when a table is dispayed through this datagrid all the foreign keys will be displayed in a combobox which will display the foreign key string and with value the ID of that foreign key to be used in the current table. Also all the dataetime fields to be able to...
1
2109
by: raju5725 | last post by:
I have a MS access table and I want to export it to comma delimited text file. How do I do this programmatically using VB.NET or C#? Thanks for any help in advance. Raju
1
2375
by: SteveBark | last post by:
Hello all I am currently trying to develop a script that will take a value from an Excel spreadsheet cell and use that to run a query against an Access table to delete all rows that match the cell. I have tried to do this by first using a recordset and then secondly using a db.Execute (sqlstring). The idea of using the recordset was that I thought it would return all of the records matched, however it just deletes the 1 row not all of...
1
2374
by: Reef81 | last post by:
Does anyone know a way to have the search parameters displayed in the query or report? For example, if I set up a parameter to search all entries in my table, is there a way to have the search terms I entered displayed next to those entries? I would like to search with multiple parameters (multiple search words) and have the results show me which entries were found with which corresponding search words. Any help would be greatly...
4
1823
by: MissFatma | last post by:
hi i have question i've wrote program using visual stido 2005 C# i have to search a datatable on Access i can connect to it but i have to search using the e-mail address i don't know how? all what i can search using the Row number which is much easier than have long number.. any one can help me by the code?
12
8173
by: anand padia | last post by:
I have a master access table where we store all the employee information. I have various application developed in excel which imports and uses information in master. Now I want to develop a excel application that will import all the records from access table or some particular data (defined by field id) in excel spreadsheet. (***successfully acomplished) User would be able to view the records and make changes to the spreadsheet now when...
0
10512
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10313
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7822
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6785
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5374
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4911
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.