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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:48:59+00:00 2026-06-03T10:48:59+00:00

This is a bit of a two part question, firstly the SQL string Dim

  • 0

This is a bit of a two part question, firstly the SQL string

Dim Addcolumn As New OleDb.OleDbCommand("ALTER TABLE [" & TableName & "] ADD " & X & "", con)


    X = 0
    Do
        X = X + 1

        Addcolumn.ExecuteNonQuery() 
    Loop Until X = 8

This string is throwing up a syntx error, specifically OleDbException was unhandled, Syntax error is SQL statement

Im not sure where ive gone wrong, done some research but can’t find a fault, im sure its obvious to someone with a bit more experience.

My second part of the question is clarification on something I was wondering. If I enter new columns into a data set will it stick when I update the form? Or is it only rows that do that? And if so will creating new columns in the actual table, then copying it to the dat set, then updating the table through a table adapter work? And give me my desired rows and columns for my table?

All help is greatly appreciated

Thanks so much in advance!

Moh =)

  • 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-03T10:49:01+00:00Added an answer on June 3, 2026 at 10:49 am

    you can try

     X = 0
        Do
          Dim Addcolumn As New OleDb.OleDbCommand("ALTER TABLE [" & TableName & "] ADD COLUMN " & X      & " varchar(10) NULL", con)
    
            X = X + 1
    
            Addcolumn.ExecuteNonQuery() 
        Loop Until X = 8
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is a bit of a two parter for .Net data services. This
This question is a bit of a two-parter. First, the title question. Here's what
This might be a bit of a silly question but; If I have two
This question actually has two parts. The first part: I've been developing my first
This is a two part question. I am rendering some BSP geometry and some
This is a two part question. A dumb technical query and a broader query
I need two divs to look a bit like this: | | ---| LOGO
I've got a select with two 'special' options, a bit like this: <select> <option
This bit of code comes with new classes that are subclasses of UITableViewController... -
To this bit of code I pass the string kellogs special k and I

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.