Dim zw1 As WinForm.DropDownBox = e.Form.Controls("DropBox1")
Dim cw1 As WinForm.DropDownBox = e.Form.Controls("DropBox2")
Dim zw2 As WinForm.DropDownBox = e.Form.Controls("DropBox3")
Dim cw2 As WinForm.DropDownBox = e.Form.Controls("DropBox4")
Dim szw1 As String = zw1.text
Dim scw1 As String = cw1.text
Dim szw2 As String = zw2.text
Dim scw2 As String = cw2.text
Dim ssw As String = "文件夹设置"
Dim lst As List(Of String)
lst = Connections("彬阳数据").GetTableNames
If lst.Contains(ssw) = False Then
Dim Builder As New ADOXBuilder("彬阳数据") '要指定数据源名称
Dim tbl As ADOXTable
Builder.Open()
tbl = Builder.NewTable("文件夹设置") '创建表
With tbl
.AddColumn("执行编号" ,ADOXType.String, 50)
.AddColumn("分类" ,ADOXType.String, 60)
.AddColumn("主文件夹目录" ,ADOXType.String, 120)
.AddColumn("次文件夹目录" ,ADOXType.String, 120)
End With
Builder.AddTable(tbl, True, True) '增加表
Builder.Close()
Dim cmd As new SQLCommand
cmd.C
cmd.CommandText = "Insert Into 文件夹设置 (执行编号, 分类, 主文件夹目录, 次文件夹目录) Values(?,?,?,?)"
cmd.Parameters.Add("@执行编号","A01")
cmd.Parameters.Add("@分类","fa piao认证")
cmd.Parameters.Add("@主文件夹目录",szw1)
cmd.Parameters.Add("@次文件夹目录",scw1)
cmd.ExecuteNonQuery
cmd.CommandText = "Insert Into 文件夹设置 (执行编号, 分类, 主文件夹目录, 次文件夹目录) Values(?,?,?,?)"
cmd.Parameters.Add("@执行编号","A02")
cmd.Parameters.Add("@分类","fa piao认证")
cmd.Parameters.Add("@主文件夹目录",szw2)
cmd.Parameters.Add("@次文件夹目录",scw2)
cmd.ExecuteNonQuery
End If
这样添加报错
[此贴子已经被作者于2019/3/7 14:04:11编辑过]