插入......表格选择b作为Mysql中的table2

时间:2013-03-26 04:30:01

标签: mysql vb6

我已从Access迁移到Mysql.Codes for vb6

mobjCmd.CommandText = "INSERT INTO The123 SELECT The1 AS FirstName FROM schedule"
Set mobjRst = mobjCmd.Execute

此查询在Mysql中无效。

2 个答案:

答案 0 :(得分:0)

mobjCmd.CommandText = "INSERT INTO The123 VALUES("yOUR VALUES")"
MOBJCMD.COMMANDTEXT = "SELECT The1 AS FirstName FROM schedule"
Set mobjRst = mobjCmd.Execute

你必须划分两个CMD

答案 1 :(得分:0)

您需要为The123

指定列
mobjCmd.CommandText = @"INSERT INTO The123 (FirstName) SELECT The1 AS FirstName FROM schedule"
Set mobjRst = mobjCmd.Execute