my $crconn = Win32::OLE->new('ADODB.Connection'); my $crrs = Win32::OLE->new('ADODB.Recordset'); $crconn->open("Credentialing"); my $lastname = $rs->Fields("LastName")->{'Value'}; $lastname =~ m/^\b([A-Za-z]+)\b(.*)$/gi if ($lastname); my $rsID = $rs->Fields("ID")->{'Value'}; my $sql = "SELECT * FROM [PHYSICIAN TABLE] WHERE "; $sql .= "[PHYSICIAN TABLE]\.[LAST NAME] LIKE \'\*$1\*\';"; print SQLLOG $sql, "\n"; $crrs = $crconn->execute($sql); print LOGFILE "Foo!\n Win32::OLE->LastError()\n" if (Win32::OLE->LastError()); if ($crrs->eof) { # start matching based on the last name # now would be a good time to use the misspelling module from CPAN # this will be done at a later time $finalmatch{$rsID} = "No Match By Last Name"; }