Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9131727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:11:22+00:00 2026-06-17T08:11:22+00:00

I am working on a financial application that performs CRUD operations from Excel to

  • 0

I am working on a financial application that performs CRUD operations from Excel to SQL Server 2008 R2. The application uses VBA and ADO. I am trying to optimize the performance of an operation that loops through thousands of rows and sends updates to the database. Currently, a stored procedure gets called once for each row.

When users have slow connections to the application the performance is slow too, enough that they have started complaining. To optimize the performance, I tried:

  1. Batching all of the operations into an XML file and sending them all at once. Unfortunately the performance got worse.
  2. Next I thought of batching all of the updates in a table-valued parameter. However, VBA and ADO can’t use table-valued parameters.

I am running out of things to try. How do I improve the database performance when going from VBA to SQL Server 2008 R2?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:11:23+00:00Added an answer on June 17, 2026 at 8:11 am

    I figured it out. While there is no table-valued parameter (TVP) object available in ADO, you can execute raw SQL statements on a SQL Server connection. The solution is to:

    1. Build a SQL statement that uses a TVP
    2. Execute the SQL statement on the ADO connection.

    For example:

    Dim cnSQLServer As ADODB.Connection
    Dim rst As ADODB.Recordset
    Dim strSQL As String
    
    Set cnSQLServer = New ADODB.Connection
    cnSQLServer.Open "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Northwind;Integrated Security = SSPI"
    
    ' Build a SQL statement that uses a TVP
    strSQL = "DECLARE @ReturnMessage nvarchar(255) " + _
        "DECLARE @catType CategoryTableType " + _
        "INSERT INTO @catType" + _
        "EXEC ('" + _
        "SELECT ''Organic'', ''Organically grown produce and grains'' " + _
        "SELECT ''Conventional'', ''Non-organically grown produce and grains'' " + _
        "SELECT ''Irish'', ''Mrs. O''''Leary''''s creamery products'' " + _
        "') " + _
        "EXEC dbo.usp_InsertCategory @catType, @ReturnMessage OUTPUT; " + _
        "SELECT @ReturnMessage as ReturnMessage'"
    
    ' Execute the SQL statement on the ADO connection.
    Set rst = cnSQLServer.Execute(strSQL)
    

    The solution is described in more detail in an article about calling TVPs from MS Access: Using SQL Server 2008 Table-valued Parameters in Access 2007

    Using a TVP gave me a nice performance boost. Hope this helps someone else. Cheers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on the design of a high security application (involving financial information,
I am working with the financial tooldbox that has a type called FINTS. If
I have a (C#) genetic program that uses financial time-series data and it's currently
I am working through some C++ code from Financial Instrument Pricing Using C++ -
I'm working on a simple financial application using MVVM & LinqToSql. I'm trying to
I am working with a financial application and am looking for the best solution
I'm working on a small, very application-specific CMS. There's nothing financial going on, and
I'm working on updating a system that stores financial information and am using a
I am working on a financial database that I need to develop caching for.
My company has been working on a Flex dashboard that displays realtime financial information.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.