[VB.NET]大家来关注下这个问题....谢谢啦~~~~~~~~~~~~

前端之家收集整理的这篇文章主要介绍了[VB.NET]大家来关注下这个问题....谢谢啦~~~~~~~~~~~~前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
大家来关注下这个问题....谢谢啦~~~~~~~~~~~~ Private Sub Button2_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button2.Click Dim oledbCnstr As String Dim oledbDate As New DataSet oledbCnstr = provider=microsoft.jet.oledb.4.0;data source=Books.mdb Dim oledbCn As OleDbConnection oledbCn = New OleDbConnection(oledbCnstr) Dim oledbsql,oledbDel,oledbIns,oledbUpdate As String Dim oledbAdpter As OleDbDataAdapter oledbAdpter = New OleDbDataAdapter oledbCn.Open() Try oledbIns = insert into borrow (BorrowNo,CardNo,BorrowDate)values ( j001,k002,1987-01-02 ) oledbAdpter.InsertCommand = New OleDbCommand(oledbIns,oledbCn) oledbAdpter.InsertCommand.ExecuteNonQuery() oledbAdpter.Fill(oledbDate,borrow ) DataGrid1.DataSource = oledbDate.Tables( borrow ) Catch err As Exception MsgBox(err.ToString) Finally If oledbCn.State = ConnectionState.Open Then oledbCn.Close() oledbCn = Nothing End If End Try End Sub 运行有如下提示..... system.Data.oledb.oledbException:Insert into 语句语法错误 at system.Data.oledb.oledbcommand.ExcutecommandTextErrorhangdling(int32 hr) at system.Data.oledb.oledbcommand.ExcutecommandTextForsingleResult(tagDBPAAMS dbParams,Object&executeResult) at system.Data.oledb.oledbcommand.ExcutecommandText(Object&executeResult) at system.Data.oledb.oledbcommand.Excutecommand(CommandBehavior behavior,Object&executeResult) at system.Data.oledb.oledbcommand.ExcuteReaderInternal(CommandBehavior behavior,String method) at system.Data.oledb.oledbcommand.ExcuteNoQuery() at adpter1.Form1.Button2_Click(Object sender,EventArgs e) in D:/vb.net练习数据库/adpter1/Form1.vb:line 152 各位大侠给点意见,谢谢哦... at system.Data.oledb.oledbcommandText(Object&executeResult) __________________________________________________________________________ 补充下 borrowNo文本格式 CardNo文本 BorrowDate日期 oledbIns = insert into borrow (BorrowNo,1987-01-02 ) 是在一行显示 __________________________________________________________________________ 你这个 ) 是中文的... 改成) __________________________________________________________________________ 哈哈,最好的方法就是先写好sql再粘过来 __________________________________________________________________________ ^_^,谢谢啦,解决了,这个问题困扰我几天了,真的感谢 amandag(高歌)给你加分 __________________________________________________________________________ 原文链接:https://www.f2er.com/vb/263404.html

猜你在找的VB相关文章