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 9152417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:02:20+00:00 2026-06-17T12:02:20+00:00

I have read this entry (http://stackoverflow.com/questions/8513185/vbscript-to-correctly-re-format-a-delimited-text-file) many times and still do not understand the

  • 0

I have read this entry (http://stackoverflow.com/questions/8513185/vbscript-to-correctly-re-format-a-delimited-text-file) many times and still do not understand the .Execute section.

WScript.Echo oTDb.Execute(Replace("SELECT * FROM [@T]", "@T", sTbl1)) _
.GetString( adClipString, , "|", vbCrLf, "" )

The pieces I am having trouble with are the [@T] and “@T”.

I know it is the “@T” that is reading the filename in the schema file and and the [@T] must be using the “@T” as a substitute. What I cannot find out is where this is mentioned/spoken about.

Some addition questions I have are:
1. If the filename can be substituted with a variable then what else can?
2. What are the rules for maintaining variables
Do they have to start with the @ symbol
Are there any reserved words
If they have to start with the @ symbol, does the next character have to be a letter

  • 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-17T12:02:21+00:00Added an answer on June 17, 2026 at 12:02 pm

    As I am responsible for @Milton’s worry/puzzlement:

    There is no variable interpolation/substitution in VBScript. Other languages – e.g. Perl – will splice variables or even expression results into string literals when you mark the replacements with special symbols. No such funny letters in VBScript.

    SQL dialects allow parameterized commands in which parts to be replaced are marked by ? and/or names prefixed by symbols like @. But here ADO never sees the @T – VBScript’s Replace() function has interpolated the table name before the resulting strings is send to .Execute().

    Building complex strings from parts (SQL statements, commandlines for .Run or .Exec, …) by concatenation is cumbersome. The most important drawback is that you can’t (proof) read the string anymore for all those ” and &.

    A simple workaround is to use Replace(), as in

    [sResult = ] Replace("SELECT * FROM [@T]", "@T", sTbl1)
    

    I used the @ just for letting the placeholder stand out. As you would have to stack/nest the Replace() calls when you need more substitutions on the template, other strategies are worth considering:

    1. writing a function that takes a template string and a dictionary of replacements to apply Regexp.Replace() to the string
    2. using .NET’s System.Text.StringBuilder and its .AppendFormat to do the slicing in a sprintf like style
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read from this article http://codahale.com/how-to-safely-store-a-password/ and it says using a salt isn't
I have read this in order to compile NH spatial for Nhibernate 3.1 http://build-failed.blogspot.it/2012/02/nhibernate-spatial-part-2.html
~ On my articles page ( http://www.adrtimes.squarespace.com/articles ) I have each entry start with
Based on this post http://www.adam-bien.com/roller/abien/entry/ejb_3_1_killed_the I use in my app @Named @Stateless bean for
I have read this blog entry about using relative layout to optimize layout in
I have built a simple database posted here (Access 2007 format): http://www.derekbeck.com/Database1.accdb I have
I have read this question and the simple and clear answer but it's not
I have read this thread when I got the the git: command not found
I have read this question but it's not quite what I was looking for.
I have read this article from High Scalability about Stack Overflow and other large

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.