vb.net insert into
DimstrConAsString="Provider=Microsoft.Jet.OLEDB.4.0;DataSource=2006.xls;ExtendedPrope...
Dim strCon As String = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =2006.xls;Extended Properties=Excel 8.0"
Dim myConn As New OleDbConnection(strCon)
Try
myConn.Open() '打开数据链接,得到一个数据集
Dim strcom1 = "insert into [1$](a) values(2)"
MsgBox(strcom1)
Dim objDA As OleDbCommand = New OleDbCommand(strCom1, myConn)
objDA.CommandText = strcom1
objDA.ExecuteNonQuery()
myConn.Close()
Catch a As Exception
MessageBox.Show(a.Message)
End Try
Dim strcom1 = "insert into [1$](a) values(2)"
值为数字时候可以成功
为字母或汉字时候不行 高人指点
values('XXX')
还是不行 高人快快出现 展开
Dim myConn As New OleDbConnection(strCon)
Try
myConn.Open() '打开数据链接,得到一个数据集
Dim strcom1 = "insert into [1$](a) values(2)"
MsgBox(strcom1)
Dim objDA As OleDbCommand = New OleDbCommand(strCom1, myConn)
objDA.CommandText = strcom1
objDA.ExecuteNonQuery()
myConn.Close()
Catch a As Exception
MessageBox.Show(a.Message)
End Try
Dim strcom1 = "insert into [1$](a) values(2)"
值为数字时候可以成功
为字母或汉字时候不行 高人指点
values('XXX')
还是不行 高人快快出现 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询