Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21281

ado refresh error

$
0
0
I have a Datagrid connected to an ADODC control through the properties. I am trying to get info from a table to populate the datagrid. It gives me an error as soon as i get to the adoSearch.refresh. I am using Access 2010. The following is the code using:

Private Sub Form_Load()
adosearch.connectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & GstrDB & "\bins.accdb;jet OLEDB:Database Password=sgsd"
adosearch.recordsource = gstrsearch
adosearch.refresh
end sub


gstrsearch = "Select Location, Size, Product, BinMt, Datepromised, Datechk from weekly1 WHERE Location = 'Warehouse'"

it gives me an 'Unknown Error' then a runtime error "-2147467259 (80004005) Method 'Refresh' of object 'IAdodc' failed

I have used this code in the past and it has worked. (i was using accress 2003 in the past and Microsoft.Jet.oledb.4.0)

I can open the DB in other areas in the program to open up a recordset with the code above and it works.

Viewing all articles
Browse latest Browse all 21281

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>