LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 4149 in SQL Toolkit with MSDE

I am interacting with MSDE through SQL toolkit 5.0 for creating tables and updating values. I would like to get the column names of the table in the database. Get Table Information.vi is available in the toolkit and works good. Get Column Information.vi does not work well. It does not give any error and it does not give the column names and its details either.

Then i tried sp_columns query to get the column details of a table. It gives "Error 4149 Fetch Next Record - [Microsoft][ODBC Driver Manager] Program type out of range.

Somebody help me find a solution for getting the column names of a table from the database.
0 Kudos
Message 1 of 4
(3,219 Views)
Using ADO, you can read the field names of any table you can query. Essentially, you first open a connection to the database. Next using a query that selects the desired fields, you open a recordset that contains the details of the data you're fetching. Using this recordset you open each field and read properties that give you such information as the field's value, name and actual size.

Let me know the version of LV are you're using and I can send you a VI that shows the basic process.

Alternately, SQL databases maintain in insternal system tables the structures of objects you create--including the definition of tables. Typically you can query those tables for objects in your own schema.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(3,219 Views)
Thanks for your quick reply. I am using LabVIEW 6.1. I will try as per your suggesstion.

A. Senthilntahan
0 Kudos
Message 3 of 4
(3,219 Views)
Here is a VI that shows the basic process. Obviously there are no subvis, but the intent was to show the basic flow of the process.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 4
(3,219 Views)