WorkerBeeJ
Programmer
Hello,
I'm having a problem with a script that I'm using to correct some typos in a sql database. I'm able to retrieve fields, but cannot update them. Here's the error I'm getting:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
Query-based update failed because the row to update could not be found.
''''''''''Begin Partial Code''''''''''
WHILE NOT recSet.EOF
newStreet = recSet.Fields("street"
newStreetName = recSet.Fields("streetName"
for each regExpMatch in regExpr.Execute(newStreet)
dirtyBit = false
for i= 0 to 103
typo = corrections(i,0)
correction = corrections(i,1)
if regExpMatch = Typo then
dirtyBit = true
newStreet = Replace(newStreet,typo,correction)
newStreetName = Replace(newStreetName,typo,correction)
end if
next
if dirtyBit then
recSet.Fields("street"
= newStreet
recSet.Fields("streetName"
= newStreetName
recSet.Update '***Problem, row not found***
dirtyBit = false
end if
next
recSet.MoveNext
WEND
''''''''''End Partial Code''''''''''
The pattern for the regular expression is "\b\w+\b" (i.e., it finds whole words). The streetName for each row is equal to the street without it's direction. E.g.,
street: S Broadway Ave
streetName: Broadway Ave
If there's not enough info here, please let me know.
Any help would be greatly appreciated! Thanks!
I'm having a problem with a script that I'm using to correct some typos in a sql database. I'm able to retrieve fields, but cannot update them. Here's the error I'm getting:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
Query-based update failed because the row to update could not be found.
''''''''''Begin Partial Code''''''''''
WHILE NOT recSet.EOF
newStreet = recSet.Fields("street"
newStreetName = recSet.Fields("streetName"
for each regExpMatch in regExpr.Execute(newStreet)
dirtyBit = false
for i= 0 to 103
typo = corrections(i,0)
correction = corrections(i,1)
if regExpMatch = Typo then
dirtyBit = true
newStreet = Replace(newStreet,typo,correction)
newStreetName = Replace(newStreetName,typo,correction)
end if
next
if dirtyBit then
recSet.Fields("street"
recSet.Fields("streetName"
recSet.Update '***Problem, row not found***
dirtyBit = false
end if
next
recSet.MoveNext
WEND
''''''''''End Partial Code''''''''''
The pattern for the regular expression is "\b\w+\b" (i.e., it finds whole words). The streetName for each row is equal to the street without it's direction. E.g.,
street: S Broadway Ave
streetName: Broadway Ave
If there's not enough info here, please let me know.
Any help would be greatly appreciated! Thanks!