本文介绍了IErrorInfo.GetDescription因E_FAIL(0x80004005)而失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 这是我的代码 Dim s As 字符串 s = SELECT Voter.SrNo,Voter.YadiNo,Voter.FullName,Voter.Gender,Voter.Age,Voter.HouseNo,Voter.CardNo,Voter.CardNo,Voter.Cast FROM Voter WHERE(((Voter) .Cast)[Is Null])) Dim da As 新 OleDbDataAdapter(s,My.Settings.trialConnectionString) Dim ds 作为 新 DataSet da.Fill(ds, 选民) DataGridView1.DataSource = ds.Tables( 选民) 错误 IErrorInfo.GetDescription失败了E_FAIL(0x80004005)解决方案 我认为关键字问题( Cast )这里。请尝试以下方法 s = SELECT Voter.SrNo ,Voter.YadiNo,Voter.FullName,Voter.Gender,Voter.Age,Voter.HouseNo,Voter.CardNo,Voter.CardNo, [Voter.Cast] FROM Voter WHERE [选民。演员] 我不知道您正在使用什么数据库?这就是为什么我只提到部分查询(我删除了NULL条件)。所以在执行之前完成查询。 Dim s 作为 字符串 s = SELECT Voter.SrNo,Voter.YadiNo,Voter.FullName,Voter.Gender,Voter.Age,Voter.HouseNo,Voter.CardNo,Voter.CardNo,Voter.Cast FROM Voter WHERE(((Voter.Cast)[Is Null])) Dim da As 新 OleDbDataAdapter(s,My.Settings.trialConnectionString) Dim ds As 新 DataSet da.Fill(ds, 选民) DataGridView1.DataSource = ds.Tables( 选民) 在上面的代码中有一个cast是一个保留的关键字 只有我将演员改为castt并且可以是excute Dim s As String s = SELECT Voter.SrNo,Voter.YadiNo,Voter.FullName,Voter.Gender,Voter.Age,Voter.HouseNo ,Voter.CardNo,Voter.CardNo,Voter.Castt FROM Voter WHERE(((Voter.Castt)[Is Null])) Dim da 作为 新 OleDbDataAdapter(s,My.Settings.trialConnectionString) Dim ds As 新 DataSet da。填充(ds, 选民) DataGridView1.DataSource = ds.Tables( 选民) this is my code Dim s As String s = "SELECT Voter.SrNo, Voter.YadiNo, Voter.FullName, Voter.Gender, Voter.Age, Voter.HouseNo, Voter.CardNo, Voter.CardNo, Voter.Cast FROM Voter WHERE (((Voter.Cast) [Is Null]))" Dim da As New OleDbDataAdapter(s, My.Settings.trialConnectionString) Dim ds As New DataSet da.Fill(ds, "voter") DataGridView1.DataSource = ds.Tables("voter")ErrorIErrorInfo.GetDescription failed with E_FAIL(0x80004005) 解决方案 I think keyword problem(Cast) here. Try the followings = "SELECT Voter.SrNo, Voter.YadiNo, Voter.FullName, Voter.Gender, Voter.Age, Voter.HouseNo, Voter.CardNo, Voter.CardNo, [Voter.Cast] FROM Voter WHERE [Voter.Cast]"I don't know what database you're using? that's why I mentioned only partial query(I removed NULL condition). So Complete the query before execution.Dim s As String s = "SELECT Voter.SrNo, Voter.YadiNo, Voter.FullName, Voter.Gender, Voter.Age, Voter.HouseNo, Voter.CardNo, Voter.CardNo, Voter.Cast FROM Voter WHERE (((Voter.Cast) [Is Null]))" Dim da As New OleDbDataAdapter(s, My.Settings.trialConnectionString) Dim ds As New DataSet da.Fill(ds, "voter") DataGridView1.DataSource = ds.Tables("voter")In the upper code there is an "cast" is an the reserved key wordonly i was change the "cast" into "castt" and it can be excuteDim s As String s = "SELECT Voter.SrNo, Voter.YadiNo, Voter.FullName, Voter.Gender, Voter.Age, Voter.HouseNo, Voter.CardNo, Voter.CardNo, Voter.Castt FROM Voter WHERE (((Voter.Castt) [Is Null]))" Dim da As New OleDbDataAdapter(s, My.Settings.trialConnectionString) Dim ds As New DataSet da.Fill(ds, "voter") DataGridView1.DataSource = ds.Tables("voter") 这篇关于IErrorInfo.GetDescription因E_FAIL(0x80004005)而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-26 01:15