rony_78 Posted December 4, 2012 Share Posted December 4, 2012 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 More sharing options...
justsomeguy Posted December 4, 2012 Share Posted December 4, 2012 SELECT * INTO NewTable FROM OldTable Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now