主题:高手才能解决的问题!!!!快来!!
在Access中创建新表时如没指定字段为主键但要有主键则会自动创建一个"ID"字段,数据类型为“自动编号”。那么在SQL Server2000中可以创建这样的字段吗??
如果不行,那么我想问一下在一个表中没有主键是不是就不可以进行更新吗??
Private Sub btupdate_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btupdate.Click
myrow.Item(4) = Trim(TextBox1.Text)
myrow.Item(1) = Trim(TextBox1.Text)
myrow.Item(3) = Trim(TextBox2.Text)
myrow.Item(2) = Trim(TextBox3.Text)
mytable.GetChanges()
cmd = New OleDbCommandBuilder(ADOcmd)
ADOcmd.Update(ds, "result_info")
MsgBox("学籍信息修改成功!", vbOKOnly + vbExclamation, "警告")
TextBox1.Enabled = False
TextBox2.Enabled = False
TextBox3.Enabled = False
TextBox4.Enabled = False
'重新设置为只读
End Sub
Private Sub showdata()
myrow = mytable.Rows.Item(rowno)
TextBox1.Text = myrow.Item(4).ToString
TextBox2.Text = myrow.Item(1).ToString
TextBox3.Text = myrow.Item(3).ToString
TextBox4.Text = myrow.Item(2).ToString
End Sub
实在不懂了!!求救呀!
如果不行,那么我想问一下在一个表中没有主键是不是就不可以进行更新吗??
Private Sub btupdate_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btupdate.Click
myrow.Item(4) = Trim(TextBox1.Text)
myrow.Item(1) = Trim(TextBox1.Text)
myrow.Item(3) = Trim(TextBox2.Text)
myrow.Item(2) = Trim(TextBox3.Text)
mytable.GetChanges()
cmd = New OleDbCommandBuilder(ADOcmd)
ADOcmd.Update(ds, "result_info")
MsgBox("学籍信息修改成功!", vbOKOnly + vbExclamation, "警告")
TextBox1.Enabled = False
TextBox2.Enabled = False
TextBox3.Enabled = False
TextBox4.Enabled = False
'重新设置为只读
End Sub
Private Sub showdata()
myrow = mytable.Rows.Item(rowno)
TextBox1.Text = myrow.Item(4).ToString
TextBox2.Text = myrow.Item(1).ToString
TextBox3.Text = myrow.Item(3).ToString
TextBox4.Text = myrow.Item(2).ToString
End Sub
实在不懂了!!求救呀!