Jump to content

SQL Server Can Create Table But Can not List Tables and Clums


Recommended Posts

Recently I use NI SQL Toolkit Connect MS Server, I use System DSN, It's OK to Connect the Database and It's OK to Create Table in the Default Database, but I can't ListTables and Can't List All Column's Information.Why? Please Help,tks!

Then I use UDL File Path as the input of Open Connection VI, This time can Obtain All tables In the database ,but when I want to List All column's information of one specific Table, the Error described Below, must I set some permiition in database? why this error happened? tks! images below is the error dailog and the create table vi and the List Column vi

post-356-1164356395.png?width=400

post-356-1164356460.png?width=400

post-356-1164356475.png?width=400

Link to comment

My SQL is a little rusty, but here goes: it could be a permissions issue, but I doubt it since you're able to create the table and insert data. Have you looked at the table using something other than LabVIEW to make sure that the data actually goes into the table? Can you post the database file to we can check it out? What's in the "table" control? You might actually have more than one table in your DB - how big is the 1D string array that comes out of "DB Tools List Tables"? Are you sure indexing out the 0th element is getting the table you expect and not one that already existed?

Link to comment
My SQL is a little rusty, but here goes: it could be a permissions issue, but I doubt it since you're able to create the table and insert data.

No, I only can Create the Table, I can't Insert data! the Error Message is the Same!

Have you looked at the table using something other than LabVIEW to make sure that the data actually goes into the table? Can you post the database file to we can check it out? What's in the "table" control?

Yes ,the Created table is here, and the Columns is what I want to creat!

You might actually have more than one table in your DB - how big is the 1D string array that comes out of "DB Tools List Tables"? Are you sure indexing out the 0th element is getting the table you expect and not one that already existed?

It's only a test, so I am sure indexing out the 0th element is getting the table I expect and not one that already existed!

Link to comment
Hi,

I tested "DB Tools List Tables.vi" in order to check your problem. (I'm using LV 7.1.1)

In my Access database, table referenced at index 0 doesn't really exist. It seems to be a metabase.

So i think you must access first table of your database with index 1.

I hope that solves your problem :)

No,I Probed my 0th element, It is one of table in my Database!

I think we're all a little mixed up here - is the problem that you can't write data into a table, or that you can't read it out from a table?

Yes, I Can Create the Table, But I can not write data into a table and can not read it out from a table!

Link to comment
Yes, I Can Create the Table, But I can not write data into a table and can not read it out from a table!

So let's assume that the real problem is that you can't write into the table and ignore the reading issue for the moment. Are you sure you have permission to write into tables? Check you persmissions. Can you upload the DB for us to look at?

Link to comment

Yes, check the permissions and if that's okay, then you need to double-check data types. The types of each field must match the types in LabVIEW.

I second Chris's request to see the database; even screen captures showing the fieldnames and types and the LV data you are trying to write are good.

Link to comment
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.