求助,关于 INSERT INTO
向数据库录入数据,按开始号结束号录入,如开始号是1,结束号是5,那就录入1,2,3,4,5但是提示
程序代码:
Private Sub Command1_Click() ks = Int(Text1.Text) js = Int(Text2.Text) SJK Sql2 = "select max(id) from 数据" For X = ks To js maxid = Cnn.Execute(Sql2).Fields(0).Value + 1 ' Str = Split(Label1.Caption, " ") ' Sql = "insert into 数据 values(" & maxid & "," & X & "," & Combo1.Text & ",'" & Combo2.Text & "',#" & Str & "#)" Sql = "insert into 数据 values(" & maxid & "," & X & "," & Combo1.Text & ",'" & Combo2.Text & "',#" & Label1.Caption & "#)" Cnn.Execute (Sql) Next MsgBox "成功写入数据" End Sub
百度说加[]还是不行,请老师帮看看,谢谢
VB求助.rar
(198.81 KB)