gpalmer711
IS-IT--Management
Hi Guys and Gals,
This post is a little long winded so I apologise now, however I thought that it was important to give you the full situation.
I am currently writing an application in VB6. My client does a lot of selling via Amazon and wants to also have their own website to sell things from, including their full Amazon catalogue. Currently this stands at 2097 items.
I have developed the website and am working on the way to retrieve the amazon catalogue and upload it to the website. Amazon provide a service that allows you to retrieve details from their database, using this I can retrieve XML documents that contain the catalogue. Unfortunatly Amazon limit this to 10 items per XML file, so currently I have to retrieve 210 of them. Then parse the relevant data from the XML documents into arrays, then upload this to the database. I currently have it all working fine. The problem that I have is the time it is taking to complete the task.
Downloading all 210 XMl files takes only a couple of minutes on a broadband connection which is fine. Parsing all the information from them takes less than a minute, again this is also fine. However getting the data into the data base currently takes over 4 hours.
Now the package that the client is using, and can afford, only allows for Access databases. The access database that I have designed contains all information, such as orders placed, customers, etc... So I only need to update one table.
The way that I thought would be the easiest way of doing it would be create a asp document that used INSERT sql statements to add the records to the database. So on to the actual problem - Thanks for staying with me so far.
I have a form in the VB app that has a richtextbox, I then have the following code that populates the richtextbox. It is this that currently takes 4 hours and 11 minutes.
All variables are declared in the code, if not above in a Module.
intRecordsChecked currently = 2097 but will change as and when the catalogue changes.
Can anyone see a better/quicker way of doing this? Any input would be appreciated.
Greg Palmer
Freeware Utilities for Windows Administrators.
This post is a little long winded so I apologise now, however I thought that it was important to give you the full situation.
I am currently writing an application in VB6. My client does a lot of selling via Amazon and wants to also have their own website to sell things from, including their full Amazon catalogue. Currently this stands at 2097 items.
I have developed the website and am working on the way to retrieve the amazon catalogue and upload it to the website. Amazon provide a service that allows you to retrieve details from their database, using this I can retrieve XML documents that contain the catalogue. Unfortunatly Amazon limit this to 10 items per XML file, so currently I have to retrieve 210 of them. Then parse the relevant data from the XML documents into arrays, then upload this to the database. I currently have it all working fine. The problem that I have is the time it is taking to complete the task.
Downloading all 210 XMl files takes only a couple of minutes on a broadband connection which is fine. Parsing all the information from them takes less than a minute, again this is also fine. However getting the data into the data base currently takes over 4 hours.
Now the package that the client is using, and can afford, only allows for Access databases. The access database that I have designed contains all information, such as orders placed, customers, etc... So I only need to update one table.
The way that I thought would be the easiest way of doing it would be create a asp document that used INSERT sql statements to add the records to the database. So on to the actual problem - Thanks for staying with me so far.
I have a form in the VB app that has a richtextbox, I then have the following code that populates the richtextbox. It is this that currently takes 4 hours and 11 minutes.
Code:
Private Function CreateSQL()
Dim strStartTime, strEndTime
strStartTime = Time
Dim intCurRec As Integer
For intCurRec = 0 To intRecordsChecked
rtbSQL.Text = rtbSQL.Text & "INSERT INTO catalogue VALUES (,"
rtbSQL.Text = rtbSQL.Text & "'" & colExchangeID(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colListingID(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colASIN(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colTitle(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colArtist(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colPrice(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colCurrency(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colStartDate(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colEndDate(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colStatus(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & colQuantity(intCurRec) & ","
rtbSQL.Text = rtbSQL.Text & colQuantityAllocated(intCurRec) & ","
rtbSQL.Text = rtbSQL.Text & "'" & colCondition(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colSubCondition(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & "'" & colFeaturedCategory(intCurRec) & "',"
rtbSQL.Text = rtbSQL.Text & ");"
rtbSQL.Text = rtbSQL.Text & vbCrLf
Next intCurRec
strEndTime = Time
MsgBox "Start Time = " & strStartTime & " - End Time = " & strEndTime
End Function
All variables are declared in the code, if not above in a Module.
intRecordsChecked currently = 2097 but will change as and when the catalogue changes.
Can anyone see a better/quicker way of doing this? Any input would be appreciated.
Greg Palmer
Freeware Utilities for Windows Administrators.