Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Speed Issue QB2008 & VB.net 2005Search Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v9 Forum

 New Topic 
 
 Post Reply 
[1]  
 Speed Issue QB2008 & VB.net 2005 
 Author   Message 
  Pete 
  
 Group: Members 
 Posts: 17 
 Joined: 2007-01-06 
 Profile
 Posted : 2008-11-18 06:23:21

 I am trying to write a ASP page to enable staff to import a file of payment recipts into QB.  The code below is only part completed , but i have already encountered a horrific speed/ time problem.

Basicly in the code below, I'm reading a text file and grabbing the invoice number then looking up the TxnID and CustomerRefListID  form the InvoiceLine when the InvoiceLine.RefNumber matches the invoice number in the import file

from a btn click event on the asp page i run the following in vb

        Try
            ' open connection to QuickBooks
            cnQODBC = New System.Data.Odbc.OdbcConnection("DSN=QuickBooks Data")
            cnQODBC.Open()

            ' Read 13 lines out the file
            Try
                For LineCounter = 1 To 13
                    InputFileLine = Sr.ReadLine
                Next

                Do
                    ' First Record
                    InputFileLine = Sr.ReadLine
                    daQODBC = New System.Data.Odbc.OdbcDataAdapter("SELECT TxnID, CustomerRefListID From InvoiceLine where RefNumber = '" & Trim(Mid(InputFileLine, 43, 6)) & "'", cnQODBC)
                    dsQODBC = New System.Data.DataSet
                    daQODBC.Fill(dsQODBC, "TempTable")
                    strmsg = dsQODBC.Tables(0).Rows(1).Item(0).ToString
                    ' Finished with dataset so dispose
                    daQODBC.Dispose()
                    dsQODBC.Dispose()

                Loop Until InStr(1, InputFileLine, "Transaction Count") > 0
            Catch ex As Exception
                MsgBox("ex " & ex.Message)
            End Try
        Catch exConnect As Exception
            ' write error with opening
            MsgBox("exConnect " & exConnect.Message)
        Finally
            ' Clean up
            Sr.Close()
            Sr.Dispose()
            cnQODBC.Close()
            cnQODBC.Dispose()

        End Try

I was expecting this to whip through fairly fast but so far it has taken over an hour. Every thing is running on a local dev machine. Optimizer is set on, Optimize data is set to 'The start of every new connection( with load updated data).  As i stated before this percedure isnt complete as once the record has been located I will then do an update. I must be doing something wrong for this to be taking so long, has anyone any suggestions for the novice programmer to try and speed this up

thanks in advance

 

 

 
i really do need help, this computer stuff is like double dutch  
 
  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-11-18 10:43:10

Each Visual Studio .aspx page that causes a request to QODBC MUST have AspCompat="true" or else things will run slowly.

Try looking at: Performance - VB Demo verus my C# app  

 

  Top 
  Pete 
  
 Group: Members 
 Posts: 17 
 Joined: 2007-01-06 
 Profile
 Posted : 2008-11-18 16:46:06

cheers Tom , that did the trick

 

 

 
i really do need help, this computer stuff is like double dutch  
 
  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to