Home » Microsoft TechnologiesRSS

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

I run the following code in access 2007 , it work fine

SELECT ind , subject, eventdate , Section FROM tnews,tsection where posttimestart=#2010-08-31# AND department=tsection.id
but when I put them in function call
<WebMethod()> Public Function getNewsAndEvent(ByVal _date As DateTime) As DataSet

        ConnectDB()

        Dim SQLstr As String
        SQLstr = SQLstr & "SELECT  ind, subject, '*' & subject  as Nsubject, eventdate,eventdateEnd , Section  FROM tNews,tSection where posttimestart=#" & _date & "# AND department=tsection.id"



        Dim ds As DataSet = New DataSet
        ad = New OleDbDataAdapter(SQLstr, objConnection)
        ad.Fill(ds, "news")
        DisconnectDB()
        Return ds
    End Function

I always get error , what is the posible mistake that I made??
Thank you!


 

2 Answers Found

 

Answer 1

Hi,

I think everything is correct....

But what is "news" in the below line of code.

 ad.Fill(ds, "news") ,

I didnt find any more objects with the same name in your code.. Check it.

 

Answer 2

>But what is "news" in the below line of code.

 >ad.Fill(ds, "news") ,

>I didnt find any more objects with the same name in your code.. Check it.

 1) actually, I don't know what is , I just ramdon give a  mane !

 if it suppose an object that where in from and when it get use ? loos not like the object that we use like in java, by the way I chage the "news" to Tnews" , which I am sure it is unique in my class, but still get the same error .

2) the funny thing is if I  move Section in my  function then the  function work fine.  Section is the column in tSection and two tables  join by department=tsection.id

How can the column cause the problem?

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter