Hi all,
I need to input a string into a column named "EventType". The code should first check if the column "Agent Name" contains any strings. If there is none, it will input "IBM Director" into the EventType column.
Once it has looped through the agent names, the code will then loop through the Details column and input into EventTypes based on what is displayed within the string.
These are the codes that I am using to achieve this, however nothing is being input into the EventType column. What am I doing wrong? - Private Sub Command11_Click()
-
Dim dbs As DAO.Database
-
Dim rst As DAO.Recordset
-
-
Set dbs = CurrentDb
-
Set rst = dbs.OpenRecordset("Final")
-
-
If Not rst.EOF Then
-
Do
-
rst.Edit
-
If InStr(rst![AgentName], " ") Then
-
rst![EventType] = "IBM Director"
-
End If
-
rst.Update
-
rst.MoveNext
-
Loop Until rst.EOF
-
End If
-
If Not rst.EOF Then
-
Do
-
rst.Edit
-
If InStr(rst![Details], ">>>>") Then
-
rst![EventType] = "TEC Notice"
-
ElseIf InStr(rst![Details], "SERVICE NOT RUNNING") Then
-
rst![EventType] = "Wintel Services"
-
ElseIf InStr(rst![Details], "_ntService") Then
-
rst![EventType] = "Wintel Services"
-
ElseIf InStr(rst![Details], "LOGICAL DRIVE UTIL") Then
-
rst![EventType] = "Winte Logical Disk"
-
ElseIf InStr(rst![Details], "ntDiskFree") Then
-
rst![EventType] = "Winte Logical Disk"
-
ElseIf InStr(rst![Details], "Ntdriveutil") Then
-
rst![EventType] = "Winte Logical Disk"
-
ElseIf InStr(rst![Details], "FILESYSTEM:") Then
-
rst![EventType] = "Unix/Linux Filesystems"
-
ElseIf InStr(rst![Details], "Filesysuse") Then
-
rst![EventType] = "Unix/Linux Filesystems"
-
ElseIf InStr(rst![Details], "CPU OFFLINE:") Then
-
rst![EventType] = "UNIX CPU Offline"
-
ElseIf InStr(rst![Details], "Missing") Then
-
rst![EventType] = "Unix/Linux Process"
-
ElseIf InStr(rst![Details], "CPU UTILIZATION:") Then
-
rst![EventType] = "CPU Utilization"
-
ElseIf InStr(rst![Details], "errpt") Then
-
rst![EventType] = "INFRA Logfile"
-
ElseIf InStr(rst![Details], "SWAP") Then
-
rst![EventType] = "UNIX/Linux Memory"
-
ElseIf InStr(rst![Details], "Thrashing:") Then
-
rst![EventType] = "UNIX/Linux Memory"
-
ElseIf InStr(rst![Details], "realmem") Then
-
rst![EventType] = "UNIX/Linux Memory"
-
ElseIf InStr(rst![Details], "PAGING SPACE:") Then
-
rst![EventType] = "Wintel Memory"
-
ElseIf InStr(rst![Details], "nonpage") Then
-
rst![EventType] = "Wintel Memory"
-
ElseIf InStr(rst![Details], "Ntmem") Then
-
rst![EventType] = "Wintel Memory"
-
ElseIf InStr(rst![Details], "oqsql") Then
-
rst![EventType] = "Database"
-
ElseIf InStr(rst![Details], "DB2DIAG") Then
-
rst![EventType] = "Database"
-
ElseIf InStr(rst![Details], "uddb2") Then
-
rst![EventType] = "Database"
-
ElseIf InStr(rst![Details], "Zombie") Then
-
rst![EventType] = "UNIX/Linux Zombie Process"
-
ElseIf InStr(rst![Details], "uxphysicalmem") Then
-
rst![EventType] = "UNIX/Linux Memory"
-
ElseIf InStr(rst![Details], "uxPageScan") Then
-
rst![EventType] = "UNIX/Linux Memory"
-
ElseIf InStr(rst![Details], "ntCPUUtilization") Then
-
rst![EventType] = "CPU Utilization"
-
ElseIf InStr(rst![Details], "same process") Then
-
rst![EventType] = "Wintel Process"
-
ElseIf InStr(rst![Details], "_ntproc") Then
-
rst![EventType] = "Wintel Process"
-
ElseIf InStr(rst![Details], "Event_ID") Then
-
rst![EventType] = "Wintel Eventlog"
-
ElseIf InStr(rst![Details], "MQ error") Then
-
rst![EventType] = "INFRA Logfile"
-
ElseIf InStr(rst![Details], "MQMONITORLOG") Then
-
rst![EventType] = "INFRA Logfile"
-
ElseIf InStr(rst![Details], "_MSG") Then
-
rst![EventType] = "INFRA Logfile"
-
ElseIf InStr(rst![Details], "logline") Then
-
rst![EventType] = "Other logfile"
-
ElseIf InStr(rst![Details], "strscan") Then
-
rst![EventType] = "Other logfile"
-
ElseIf InStr(rst![Details], "NTSrvc") Then
-
rst![EventType] = "Wintel Services"
-
ElseIf InStr(rst![Details], "Ntdrivutil") Then
-
rst![EventType] = "Winte Logical Disk"
-
ElseIf InStr(rst![Details], "uxFilesys") Then
-
rst![EventType] = "Unix/Linux Filesystems"
-
ElseIf InStr(rst![Details], ":") Then
-
rst![EventType] = "Others"
-
End If
-
rst.Update
-
rst.MoveNext
-
Loop Until rst.EOF
-
End If
-
End Sub
1 837
UPDATE:
I think the problem lies with the code that checks the agent name. When I removed it, it managed to populate the EventType column based on the details. But I still need to find out how to check the agent name too.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jim |
last post by:
im using asp.net, C# to enter data into a table in sql
server...however im getting this error:
Input string was not in a correct format.
Description: An unhandled exception occurred during the...
|
by: nsj |
last post by:
I am working with a web applicaction that accesses a SQL Server database. I
need the value of the 'id' column of the last inserted row in the table
'PERSON'. The SQL statement for that purpose is:...
|
by: phmyhn |
last post by:
I have two web pages, one is viewlarger.aspx, another one is
shoppingcart.aspx. On the viewlarger.aspx, when clicking "add to cart"
image button, the sub appends the id (passed from another page...
|
by: Ottar |
last post by:
I have a few numeric fields, and when I update i get the error: "Input string
was not in a correct format". Next line:" System.Number.StringToNumber(String
str, NumberStyles options, NumberBuffer&...
|
by: Mike P |
last post by:
Is it possible when populating a datagrid to populate a dropdownlist
column based upon the value populated to another row in the datagrid?
(i.e. I have a drop down which I want to populate...
|
by: bbasberg |
last post by:
Hi,
I am wondering how to get a value from one column based on another, using visual basic for applications. Here are the criteria: The first column contains status and we want the next row in...
|
by: khengi |
last post by:
Hi,
I'm a newbie, so I guess this is a question that expresses my total
ignorance, but never the less:
I have an old table into which I want to add a column that will
automatically update based...
|
by: seep |
last post by:
hi
i m finding following error on the code that i wants to use to get all record from table via store procedure with paging. the error is :
Input string was not in a correct...
|
by: ericjb |
last post by:
Hi,
I have a table with a column in which I would like to generate random numbers. I know how to use the dbms_random function but don't know how I would do what I want to do.
I would like to...
|
by: phanikumar32 |
last post by:
Hello all,
I have a table in my sql server with column name as'type' and 'Direction'
(as shown in image 1).
and from this input i want the output as below once.
(as shown in image 2).
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |