473,473 Members | 3,363 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Looking for matches, adding to match table

1. Search field "agency_name" of table "agency" for possible matches to the
agency name I plan add; put results in recordset RF.

2. Add the similar-sounding names to table "matches" using recordset RT

Several loops of step #1 are made, looking for matching strings, likely
resulting in some same agencies being added to RF on successive passes.
Previously when I did this, for step #2, I looped through each record in RF
added in step #1, and used Seek to make sure the record was not already in
RT, then added it.

The goal was so that the user could look at possible matches before deciding
to add the new agency.

I am dissatisfied with the results, and feel there must be a better way to
do this. I thought perhaps I could just .AddNew, and if I hit an error on
..Update, just discard the .Addnew in error handling and move on (?).

Better still, is there some query that I could just run Like "INSERT INTO RT
all records NOT IN RF" ?

This seems so basic, and yet ...

--
Darryl Kerkeslager
Nov 13 '05 #1
1 1322
Never mind. Found adequate solution:

rL.Open "NewAgencyTable", CurrentProject.Connection, _
adOpenKeyset, adLockOptimistic, adCmdTable
For i = 1 To sLen - 4
src = "SELECT agency_id, agency_name, agency_type " & _
"FROM su_agency WHERE agency_name Like '%" & Mid(aName, i,
4) & "%'"
rL2.Open src, CurrentProject.Connection, adOpenForwardOnly, _
adLockReadOnly, adCmdText
Do While Not rL2.EOF
rL.AddNew
rL.Fields("agency_id") = rL2.Fields(0)
rL.Fields("agency_name") = rL2.Fields(1)
rL.Update
rL2.MoveNext
Loop
rL2.Close
Next i
rL.Close
Exit Sub
handle_error:
If Err.Number = -2147217887 Then
rL.CancelUpdate
Resume Next
End If

--
Darryl Kerkeslager
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: lothar | last post by:
re: 4.2.1 Regular Expression Syntax http://docs.python.org/lib/re-syntax.html *?, +?, ?? Adding "?" after the qualifier makes it perform the match in non-greedy or minimal fashion; as few...
1
by: weston | last post by:
Has anyone ever encountered trouble with regular expressions not capturing matches specified by parentheses? I seem to have a weird situation where a regular expression is matching the String I'm...
13
by: Maxi | last post by:
I have a table (Table name : Lotto) with 23 fields (D_No, DrawDate, P1, P2,.....P21) and it has draw results from 1st Sep 2004 till date. I have another table (Table name : Check) with 15 fields...
2
by: Julia | last post by:
Hi, I need to send HTML messages and embedded properties which set by the user I would like to use fowler's Template View pattern,does any one implemented it? Thanks in advance.
1
by: darrel | last post by:
I have some vb.net code that is running a regex, matching groups, and replacing them. I'm trying to come up with a simple script that will strip all attributes from all HTML tags. This is what I...
5
by: Martien van Wanrooij | last post by:
I have been using phpdig in some websites but now I stored a lot of larger texts into a mysql database. In the phpdig search engine, when you entered a search word, the page where the search word...
11
by: abcd | last post by:
how can i determine if a given character sequence matches my regex, completely? in java for example I can do, Pattern.compile(regex).matcher(input).matches() this returns True/False whether...
1
by: Christoph Krammer | last post by:
Hello, I want to use the re module to split a data stream that consists of several blocks of data. I use the following code: iter = re.finditer('^(HEADER\n.*)+$', data) The data variable...
6
by: Ken Foskey | last post by:
I am brand new to coding C# and Visual Studio. I have worked out how to configure the ComboBox creating my own object however it leave me with a lot of management updating as the table changes....
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
Oralloy
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,...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.