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

  • Home
  • SEARCH
  • 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 7047163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:44:16+00:00 2026-05-28T02:44:16+00:00

Context: Windows7, VBScript, ADODB and ADOX. I have written some VBScript code which creates

  • 0

Context: Windows7, VBScript, ADODB and ADOX.

I have written some VBScript code which creates a database, creates three tables, loads one of them with data and then attempts to issue a set of SQL statements against these tables.

Everything works fine except that last step: The SQL statements, when taken into Access’s own query builder, work fine. They don’t appear to work outside Access and there are no error messages. The SQL statements are echoed and apparently executed but the access database contents don’t change. I’m at a loss to figure out why.

Const dbFile = "C:\database.mdb"
strDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Mode=Read|Write;Data Source=" & dbFile
...
Const adVarWChar = 202
Const adLongVarWChar = 203
Const adDouble = 5
Const adInteger = 3

Const adCmdText = 1

Const adLockOptimistic = 3
Const adOpenDynamic = 2
Const adCmdTable = &H0002
Const adUseClient = 3

...

Set objConn = CreateObject("ADODB.Connection")
objConn.CursorLocation = adUseClient
objConn.Open strDSN

Set objCmd  = CreateObject("ADODB.Command")

Set o = createobject("Std.Ini2")
o.Load "C:\Queries.ini"
d = o.GetValue("Setup", "Queries", vbNullString)
a = Split( d, ", ")
For Each s In a
    cmd = o.GetValue(s,"Query",vbNullString)
    WScript.Echo cmd

    With objCmd
        Set .ActiveConnection = objConn
        .CommandText = cmd
        .CommandType = adCmdText
        .CommandTimeout = 60
        .Prepared = True    
        .Execute
    End With
Next

Std.Ini2 is one of my own tools and talks to the INI file.

An example slice out of the INI follows:

[Qry-01b-Delete Products from Extg product-import]
Query=DELETE [Product-import].* FROM [Product-import];

[Qry-02-Append Feed To Product-import]
Query=INSERT INTO [Product-import] ( product_sku, product_name, product_price ) SELECT Feed.Col1, Feed.Col2, Feed.Col3 FROM Feed;

[Qry-03a-Delete All Records From Exisiting Category Path Builder]
Query=DELETE [Tbl_Category Path builder].* FROM [Tbl_Category Path builder];

[Qry-03b-Append Products to Category Builder]
Query=INSERT INTO [Tbl_Category Path builder] ( SKU, Product ) SELECT Feed.Col1, Feed.Col2 FROM Feed;

The three tables, as you may have worked out, are called “Feed”, “Product-import” and “Tbl_Category Path builder”.

  • 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-05-28T02:44:17+00:00Added an answer on May 28, 2026 at 2:44 am

    Solution (for me at least) was to stop using ADODB.Command and use the Execute method of ADODB.Connection instead, viz

    Set objConn = CreateObject("ADODB.Connection")
    objConn.CursorLocation = adUseClient
    objConn.Open strDSN
    
    Set ERS = CreateObject("ADODB.Recordset")
    
    Set o = createobject("Std.Ini2")
    o.Load "C:\Users\BruceAxtens\Desktop\Nextra-feed-db-instructions-queries\Nextra_Queries.ini"
    d = o.GetValue("Setup", "Queries", vbNullString)
    a = Split( d, ", ")
    For Each s In a
        cmd = o.GetValue(s,"Query",vbNullString)
        WScript.Echo cmd
        Set ERS = objConn.Execute( cmd )
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which runs using the context menu of windows explorer. I
Context: II7 on Windows7. Joomla! 1.5 At present I have the incoming traffic entire
Context We have a SharePoint site set up on a Windows Server 2008 VM
What's the difference between System.Drawing.Point and the System.Windows.Point ? In what context should which
Context: I'm in charge of running a service written in .NET. Proprietary application. It
Context: Windows7, optionally MinGW I'm thinking of writing a Tk interface for Lhogho .
I have a Windows context menu item invoking a Windows Form via these registry
I'm trying to implement Copy as path option in windows context menu ,which copies
I have read these: Adding item to the Desktop context menu in Windows http://www.informit.com/articles/article.aspx?p=169474
I have a class library used in windows (WPF) and web (ASP.NET) context. The

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.