LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database Query Error -2147467259 ADO Error: 0x80004005

Solved!
Go to solution

So I'm having more database issues.  This one I think is a bit more straight forward.  I have an Access database and in it I have a table with several columns of data.  I want to get the Maximum value of a column, from that table.  One of my columns gives me an issue with this and I'm not sure why.  Here is my code:

 

Test Get MAX.png

 

You can see reading Voltage and Power work just fine, but trying to read current returns an error.  Searching on NI's site this error is used for a lot of things and it is usually because of a 32 or 64 bit issue but in this case the read worked on two previous columns that are also an I32 but the third time it doesn't.  It also fails right away when you try Current first so it is likely something with this column.  Is there something I can check?  I opened it in Access and was able to make a query with the Query Wizard to find the min max of current.  The database it self is over 1GB so posted won't be possible.  Even pruning it might be an issue.  Any suggestions?  Thanks.

0 Kudos
Message 1 of 24
(9,235 Views)

I'm guessing this probably won't help since you are getting some data back but it may be worth a shot investigating (if you haven't already).

 

http://digital.ni.com/public.nsf/allkb/E7984C0DA0F0E65086257694005B4CB7

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 24
(9,229 Views)

Yeah I didn't link to that in my first post, but I mentioned it saying that there was an error with 32 and 64 bit applications.  But if it returns fine once, and twice for two other columns, I'm guessing that means the problem is not with the application call but something with that column.  It is the only one I've seen that behaves this way too.

0 Kudos
Message 3 of 24
(9,215 Views)

My bad.  Guess that's what I get for not reading the entire post. 

 

I have never used the ACE DB provider when communicating with mdb files, but rather the Jet provider.  See if that makes a difference. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 4 of 24
(9,199 Views)

1. What happens if you only make this SQL call on the current column?

2. Can you make other SQL calls on this column without error?

3. Can yoou make other SQL calls on all three columns without error?

Glad to answer questions. Thanks for any KUDOS or marked solutions 😉
Message 5 of 24
(9,193 Views)
Solution
Accepted by Hooovahh

Could it be that Current is a reserved word in Access? 

Message 6 of 24
(9,189 Views)

@aputman Thanks for the suggestion still new with the database toolkit.  I tried the Microsoft.Jet.OLEDB.4.0 provider and it had the same issue.

 

@PatrickLye I mentioned this in my first post but maybe it wasn't clear.  If you call just Current it fails.  I didn't test other queries because...

 

@dkfire Bingo.  I renamed it Current2 and it worked.  I then changed it back to Current but added brackets [ and ] around the column name and it worked fine.  Is this common practice to add these backets on all queries?  I noticed some have spaces in the column names and brackets were needed.

0 Kudos
Message 7 of 24
(9,181 Views)

according to http://www.msoffice.us/Access/Access20010Reserved_Words_Special_Characters.htm

CURRENT is a reserved word with Access 2010

0 Kudos
Message 8 of 24
(9,147 Views)

I don't what is common way to do.
Normally I know up front what the names of the columns are, and can adjust my query to that.

I try to avoid names with spaces, for the same reason, to make sure that a query works on all platforms.

0 Kudos
Message 9 of 24
(9,116 Views)

I tend to bracket column and table names in all cases, just to be safe. Makes things a lot easier, eventhough the SQL string itself doesn't get that much more readable from it. Smiley Wink But you get used to it and then it is really not a problem anymore. Also it is usually a good idea to add the schema name too. It is usually overkill, but makes it absolutely clear on which schema the query is meant to work on.

Rolf Kalbermatter
My Blog
Message 10 of 24
(9,104 Views)