我只想增加 id 插入的限制等于其他表
对于那件事我没有任何疑问
唯一的问题是,我不能在 id 上增加代码直到限制
标识列 2
1-----------0
2-----------5
3-----------0
依此类推,像这样,通过单击插入按钮,id 应该逐个递增直到限制
谁能帮帮我吗
RecordDate.Text = MyFormat
Dim antinull As Integer = Format(0)
BadBeg.Text = antinull
WarePcs.Text = antinull
CustPcs.Text = antinull
Returned.Text = antinull
BadEnd.Text = antinull
Try
Str = "insert into BadWarehouseInv values("
Str += Id.Text.Trim()
Str += ","
Str += """" & RecordDate.Text.Trim() & """"
Str += ","
Str += """" & BadBeg.Text.Trim() & """"
Str += ","
Str += WarePcs.Text.Trim()
Str += ","
Str += CustPcs.Text.Trim()
Str += ","
Str += Returned.Text.Trim()
Str += ","
Str += """" & BadEnd.Text.Trim() & """"
Str += ")"
Con.Open()
Cmd = New OleDbCommand(Str, Con)
Cmd.ExecuteNonQuery()
Dst.Clear()
Dad = New OleDbDataAdapter("SELECT * FROM BadWarehouseInv ORDER BY Id", Con)
Dad.Fill(Dst, "stock")
Con.Close()
Catch ex As Exception
MessageBox.Show("Could Not Insert Record!!!")
MsgBox(ex.Message & " - " & ex.Source)
Con.Close()