Jump to content

syntax error in create table statement


Recommended Posts

I want to create a table from an existing table with copying values from the existing table , I am using vb.net and ms accessI am getting syntax error in create table statement , can someone help me to solve it

Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\dtb.accdb  ")Dim CmdStr As StringCmdStr = "CREATE TABLE table1 AS (SELECT col1,col2,col3 FROM mytable)"con.Open()Dim cmd As OleDbCommand = New OleDbCommand(CmdStr, con)cmd.ExecuteNonQuery()con.Close()MsgBox("Done")

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...