473,395 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

comparing data base element with array element

hi i am working on array , i am facing a problem in comparing data base element with array element


if not (objrs("namephase")=("despArray(ctr,0)+despArray(c tr,3)")) then

or

If (StrComp(objRS("UserName")),("despArray(ctr,0)+des pArray(ctr,3)")) , vbTextCompare) = 0) Then

please help me
Aug 24 '07 #1
2 1524
jhardman
3,406 Expert 2GB
what types of problems is this giving you? Does the logic always return false?

Jared
Aug 27 '07 #2
markrawlingson
346 Expert 100+
If i'm understanding what you're trying to do correctly.. I wrote a function for this purpose not too long ago.

Expand|Select|Wrap|Line Numbers
  1.     Function IsLegitimate(aTemp,sTerm)
  2.         For i = 0 To UBound(aTemp)
  3.             If InStr(aTemp(i), sTerm) > 0 Then
  4.                 IsLegitimate = True
  5.                 Exit For
  6.             Else
  7.                 IsLegitimate = False
  8.             End If
  9.         Next
  10.     End Function
  11.  
  12.  
called like this..

Expand|Select|Wrap|Line Numbers
  1. If IsLegitimate(Split("value1 value2 value3 value4 value5"), rs("whateverfield")) then
  2. 'the function found the value of the field from the database in your array
  3. Else
  4. 'the array does not contain the value of the field from the database
  5. end if
  6.  
Aug 28 '07 #3

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

Similar topics

4
by: agent349 | last post by:
First off, I know arrays can't be compared directly (ie: if (arrary1 == array2)). However, I've been trying to compare two arrays using pointers with no success. Basically, I want to take three...
2
by: Xiangliang Meng | last post by:
Hi, all. What will we get from sizeof(a class without data members and virtual functions)? For example: class abnormity { public: string name() { return "abnormity"; }
9
by: justanotherguy63 | last post by:
Hi, I am designing an application where to preserve the hierachy and for code substitability, I need to pass an array of derived class object in place of an array of base class object. Since I...
5
by: Peter Nofelt | last post by:
Hi all, My scenario is as follows: * Receive a base 1 array (index starts at 1 instead of 0) of data from a COM component . * Need to pass this array to a .net component that requires its...
1
by: psmahesh | last post by:
Hi folks, I am comparing two arrays and removing matches from the second array from the first array. Can someone take a look at this code below and mention if this is okay and perhaps if there...
20
by: Bill Pursell | last post by:
This question involves code relying on mmap, and thus is not maximally portable. Undoubtedly, many will complain that my question is not topical... I have two pointers, the first of which is...
25
by: J Caesar | last post by:
In C you can compare two pointers, p<q, as long as they come from the same array or the same malloc()ated block. Otherwise you can't. What I'd like to do is write a function int comparable(void...
5
by: SneakyElf | last post by:
I need to write a function where the third parameter points to an address whose dereferenced value equals one of the array element's value, then the the function returns the index of the first...
1
by: chiefychf | last post by:
I'm working on a school project and I am having a few issues... The program calls for three arrays a,b,c that have to be sorted, then compared to even or odd and stored in arrays d & e, then merge...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.