msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

string comparison fails at comma

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax
Author Message
nod



Joined: 09 Oct 2007
Posts: 10

PostPosted: Fri Oct 12, 2007 5:13 pm    Post subject: string comparison fails at comma Reply with quote

I have an Access table which has an indexed field with No Duplicates
set.
Prior to adding a new record I compare the string to be inserted with
those already in the table. After the first incidence of a string is
inserted subsequent duplicates should be eliminated before reaching
the code that inserts them into the table.

I run into a problem with a string that contains a comma. A subsequent
duplicate is not being picked up and Access itself throws an error
when it detects the duplication.

String comparison methods I have tried are:

rstRecordSet.Fields(0) = Listing3(0).List(i)
and
cmp = StrComp(rstRecordSet.Fields(0), Listing3(0).List(i))

I would be grateful for a solution to this problem

Nod

Archived from group: microsoft>public>vb>syntax
Back to top
View user's profile Send private message
nod



Joined: 09 Oct 2007
Posts: 10

PostPosted: Fri Oct 12, 2007 6:40 pm    Post subject: Re: string comparison fails at comma Reply with quote

sorry !
the error lay in where I was doing the comparison not in the strings
being compared

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group