GetDocumentByKey not working in a cycle

Please, help.I have a loop that goes into a SQL database, with an ODBC connection. as i go trough the lines, i create new documents, and after that creation i modify logs in them.

To write to those documents, i use “GetDocumentByKey” to find them.

IT always works. but it fails with 2 specific, very similar entries. this is a sample of the line that fails:

Text=Cstr(“Windows Driver - CellPhone Brand (04/11/07 6.78.56)”)

Set Doc=View.GetDocumentByKey(Text,True)

Here’s the weirdness. it always works, except with this entries.

Even worst. if i move the lines in the SQL database, to the end, so my query returns them until then, Everything works.

I am refreshing the view before using GetDocByKey the view refresh property is in automatic, and i am using @Text(FieldName) in the view and Cstr(Key) in my code, to make sure i jump any non-text value problem.

Any Ideas? i need to solve this quick! thanks.

Subject: GetDocumentByKey not working in a cycle.

At a glance, you code seems ‘spot on’, and I can only come with wild guesses.

In certain languages, there is no real difference between V and W (Swedish for Example) meaning views can get very strange when the first letter is a V or a W. Could it be something like that?

If so, try using a ~ or something as the very first character and see it that helps.

ken@noteshound.com