취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Data source name not found and no default driver specified in Database Error Code -2147467259

Hey people,

 

I'm having issues when trying to use the DB Tools open connection.vi in order to write data to a SQL data table. In my VI I have two different states that handle different data based on a specific test specified to run, but both are inserted into the same SQL table. I get the unspecified error "NI_Database_API.lvlib:DB Tools Open Connec (String).vi->Main.vi<ERR>ADO Error: 0x80004005
Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified in NI_Database_API.lvlib:DB Tools Open Connec (String).vi->Main.vi"

when running one test but not the other...since the error is unspecified I'm having a hard time finding any information that might help me.

0 포인트
1/6 메시지
5,940 조회수

Code please.

aputman
0 포인트
2/6 메시지
5,927 조회수

here are screen shots of the two states that use the DB tools vi. Cannot post the whole code due to proprietary reasons. Capture1 shows the compile data state, which is the state that works. Capture shows the compile data_bend state which has the db tools that doesnt work.

모두 다운로드
0 포인트
3/6 메시지
5,919 조회수

When you say that the compile data state works, do you mean that you get no error or that data is actually being written to the database?  You are passing the errors over and over thru the loop without handling or clearing the errors, it appears.  It's hard to say without seeing more code.  

 

One thing to check is to make sure there are no spaces in the DSN.  A simple way to find out is to right click on the string and Codes Display, looking for a '\s' at the end of the string.

aputman
0 포인트
4/6 메시지
5,878 조회수

When I say it works, I mean that it gets no errors and writes the data to the SQL Table. The Connection name and table name are correct as written.

0 포인트
5/6 메시지
5,851 조회수

Did you check to see if you are clearing any errors before trying to write data?  Is there a reason that you wire the error in on the Open Connection VI?  Leave it disconnected unless you know for a fact that you are handling any errors before this SQL code executes.  

Capture.PNG

If you look at the block diagram of the Open Connection VI, the first thing it checks for is an error on the input.  If so, no connection code is executed.  

aputman
0 포인트
6/6 메시지
5,823 조회수