Hey Guys,

I have to populate an MS SQL database for a client, he has a database (.dbf) that his store uses and I am writing an app that is reading all of those record and insert them in a MS SQL database for his online store.

There's around 50 000 record and so far I open his .dbf database, go thru all the record and thought that it would be better to build a file with all my insert in it instead of doing it every loop.

But when it commes time to send it to the sql database, it takes very long and it looks like it hangs.

Here's my function that updates the database:

VB Code:
  1. Private Sub updateWebDatabase()
  2.   Dim sqlStatement As String
  3.   Dim fso As New FileSystemObject
  4.   Dim fle As TextStream
  5.  
  6.   lblProgress.Caption = "Saving to Web Database"
  7.   lblProgress.Refresh
  8.  
  9.   Set fle = fso.OpenTextFile(sqlTxtPath)
  10.  
  11.   sqlStatement = fle.ReadAll
  12.  
  13.   Set fle = Nothing
  14.   Set fso = Nothing
  15.  
  16.   Call openDB("MsSQL")
  17.     Set rs = conn.Execute(sqlStatement)
  18.   Call closeDB
  19. End Sub

Is there a way to submit my file to the sql database or is there a better way than sending it 50 000 insert's ?

Thanks a lot