但它将字符串插入到图像中的数据库中。当我删除“”然后显示错误无效的列名称。
query = "select code from info"
conn.Execute "insert into dbo.Customers (AccountNo,Amount,code) values ('" & AccountNo & "', '" & Amount & "', query)"
答案 0 :(得分:0)
如果使用mssql
,可以试试这个query = "select top 1 code from info"
conn.Execute "insert into dbo.Customers (AccountNo,Amount,code) " & _
"values ('" & AccountNo & "', '" & Amount & "', ("& query &"))"
它将在查询
中执行子查询