472,353 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 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


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

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

Aug 27 '07 #2
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
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
Aug 28 '07 #3

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

Similar topics

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...
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...
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...
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...
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...
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...
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...
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...
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...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.