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

or

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

please help me
Aug 24 '07 #1
2 1484
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...
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...
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...
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...
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...
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...
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...
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...
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...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
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. ...
2
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...
0
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...
0
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...
0
hi
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...
0
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...
0
Oralloy
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...
0
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.