LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use get column name.vi in SQL toolkit 2.0?

Due to the vi "get column name.vi" paremeters,no table name has connected to the vi. So, I want to ask how to use this vi for gain one column name of a table. Maybe there are some other ways to solve column name getting.

Thanks.
0 Kudos
Message 1 of 10
(3,867 Views)
can someone help me?
I am really confused about the problem and much work must be put down.
Thanks~~
0 Kudos
Message 2 of 10
(3,867 Views)
If you want to get the names of the columns in a table, you use Get column Information. Get Column Name is used to get the names of columns returned as the result from a query.
0 Kudos
Message 3 of 10
(3,867 Views)
Thank you great firstly!
According to your advise, I used Get column information. But unfortunately, error 4101 always occured when using a index array vi following it to get certain columnname. I want to know the index of column and row for the first columnname in database is both zero?
I think it really needs more patience to find out the error.
Then, I try another method to get results.Use the Request column informatin vi in Get column information connected to get column name. Because I thought that the principle in Get column information was similar. However, it was still wrong.And I want to ask how can I see the query results from Get column information in detail.

Thanks again.
0 Kudos
Message 4 of 10
(3,867 Views)
I don't know what error 4101 is. I haven't used the ttolkit in a while but I just did an example with a Connect, the Get Column Information, and then a Disconnect. I specified a valid DSN and a table I knew was in the database (Access). In the returned results, column 0 is the name of the database, column 2 is the table name, and column 3 is column name. With the error, do you get any text information? What is the type of database you are connecting to? Can you possibly attach an example database without many rows, to see if someone else has better luck connecting?
0 Kudos
Message 5 of 10
(3,867 Views)
Thanks!

Error 4101 Description:
Execute SQL - The connection, statement, or query handle you provided is not valid.

I don't just used the toolkit in a while,now, I am developing a irrigation system. For the table field names defined by users,column names must be known before any select operations. Do you have any other good idea about drawing out the columnname parameters?

As you know, a valid DSN and table have been also available. The database I used is Access. The bad thing to me is that there is no any text information gotten. And I think, it may be some problems in connection way which I don't find out.

Really appreciated by your reply.

Could you give me some example in the aspect?

Thank you again.
0 Kudos
Message 6 of 10
(3,867 Views)
The main my blockdiagram is in following which maybe helpful:
A table name, demonstrated to be valid,was transferred from upper procedure. It was connected to case select structure in that each column name can be drawn out as a parameter in select syntax. And each case structure is just to get column name.Certainly, the get column information vi is put in the case.

Those connection referrence is also from the upper vi. And the 4101 error also occurred even in the subVI request column information in get column information vi. No any referrence can be transferred to the next step. The connection and disconnection operations have be done right.

Waiting for help!
Thanks again.
0 Kudos
Message 7 of 10
(3,867 Views)
During these several days, I have managed myself in the problems. I found the most possibility is that the connection, statement or query handle is not valid, namely,the handle method in those information vi maybe in some format. Because when I just try a new simple VI to read columnnames in a certain table, the error still exists.
Could you give some advise ?
Thanks!
0 Kudos
Message 8 of 10
(3,867 Views)
Without seeing your program (attach it please), it's going to be hard to determine where and how you've gotten an invalid reference. I would suggest making a simple VI like I did with just a connect, get column information, and a disconnect. Once that works, you can start to debug the main VI and subVI. Fo that, you can single step through everything with probes on the references and other wires to see where the problem happens.
0 Kudos
Message 9 of 10
(3,867 Views)
Thanks a lot!
Yesterday, I solved the problem,and also have mentioned it here. Very appreciated by your great help.

Thanks again.
0 Kudos
Message 10 of 10
(3,867 Views)