?
Solved

Importing a csv file using Lotusscript......103 record limit?

Posted on 2004-04-14
9
Medium Priority
?
665 Views
Last Modified: 2013-12-18
Hopefully there's a simple answer to this.....I'm writing a Lotus Script procedure to open up a csv file and create a new document for each row in the file. The problem is, though, that when I run my code, Notes freezes after successfully importing 103 rows. Why does it get to 103 then give up?....it's not the file, as I've tried with different test data and it always gets to 103 then dies.
Here's the main loop in my code:

'Prompt the user for an import file
varImportFile = workspace.OpenFileDialog(False,"Please select the inventory file...","csv files|*.csv")
If Isempty(varImportFile) Then
      'No file was selected
      Exit Sub
End If

FileNum = Freefile()
Open varImportFile(0) For Input As FileNum
Do Until Eof(FileNum)
      Input #FileNum, strDateScanned ,varLocationCode ,varLocationDescription,varAssetCode ,varSerialNumber ,varDescription
      Set uidocInventory  = workspace.ComposeDocument("","", "Vendor Inventory")
      uidocInventory.FieldSetText "Vendor_ImportStatus","No Errors"
      uidocInventory.Save
      uidocInventory.Close
      Doevents
Loop

0
Comment
Question by:mrt1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 31

Accepted Solution

by:
qwaletee earned 1400 total points
ID: 10825187
There are notorious problems with using the UI objects in loops.  You should be using the back end NotesDocument object instead of a UIDocument:

Dim s as new notesSession
Dim db as notesDatabase
Set db = s.currentDatabase
Dim docInventory as notesDocument
Dom counter as integer
Do Until Eof(FileNum)
     Counter = counter + 1
     Print "Getting" counter
     Input #FileNum, strDateScanned ,varLocationCode ,varLocationDescription,varAssetCode ,varSerialNumber ,varDescription
     print "Got" counter
     Set docInventory  = db.createDocument
     uidocInventory.replaceItemvalue "Form" , "Vendor Inventory" 'may need to change this to the Vendory Inventory form alias
     docInventory.replaceItemValue "Vendor_ImportStatus","No Errors"
     docInventory.Save
     Doevents
     Print "Done with" counter
Loop

I also don't know why you have a Doevents -- Notes ignored it.  Also, I don't see what you do with any of the values you input, so you obviously mucked about with SOMETHING.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10825194
it is because notes cannot open uidoc to certain limit , once this reaches max it will stop executing the code

soln, do this as backend operation and use compuewithform method to calc or fire any validations .. similar to openin uidoc and saving

~Hemanth
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10825198
The limit is the ComposeDocuments. Use New Document(db), set doc.Form="Vendor Inventory" and use doc.ComputeWithForm if you want fields to be evaluated.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10825223
Aaaargh! Sorry for repeating once again (failed to push the Refresh button once again!), it must mean we're on the right track. I'm first though with ComputeWithForm ;)

Sjef
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10825295
And even that's not true :( It's late, got a headache. Problem is solved. Bye
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10825377
sjef,  Distributing visiting cards  ?? ;-)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10830906
Grmblgrmblgrmblgrmblgrmblgrmblgrmblgrmblgrmbl...
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10833042
Is that encrypted information of your visting card ?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10833273
No, it's my password at http://www.visitcards.org.
Help yourself, please.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question