DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

MS SQL queries in DIAdem 10.2

Hello,
 
I have a dBase which I manage in MS SQL server express.  I was able to use the NAVIGATOR to get a table out of my dBase (ex. tblTesting). So, in the NAVIGATOR screen I see all my column headers.
 
The next thing I would like to do, is to perform a query on this. For example, I only want the result of Test1 (ex. SELECT result FROM tblTesting WHERE TestName = 'Test1') . Is it possible to do this in the NAVIGATOR and i so, how can I do this?
 
Thanks,
0 Kudos
Message 1 of 10
(5,928 Views)

Hi Gert,

Follow the below URL to a post I made a few days ago with an "SQL Wizard" application for DIAdem.  There is no way in DIAdem 10.2 or before to run a real query from the NAVIGATOR-- to do that you need to run a script.  The "SQL Wizard" application spares you the hassle of programming the VBScript yourself.

http://forums.ni.com/ni/board/message?board.id=60&message.id=7431

Let me know if you have questions,
Brad Turpin
DIAdem Product Support Engineer
National Instrunts

0 Kudos
Message 2 of 10
(5,913 Views)
Hello,
 
thanks for the answer, but I don't seem to find a way to import my own database into your SQL wizard. How can I do this?
0 Kudos
Message 3 of 10
(5,879 Views)

Hi Gert,

If you scour that referenced post, you should find in there somewhere the instruction to edit line 12 of the SQL Wizard script, so that your data base info is in that program, either instead of or in addition to the sample data bases that are included with the application.  For an Access data base you can just insert the file path, but for all other data bases you need to enter the ADO connection string for your data base.

Ask if you have further questions,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 10
(5,866 Views)

(Sorry in advance for the duplicate message)

 

Brad-

First of all, thanks for the script; it's a very user friendly and intuitive interface.  I added our MySQL database to your list of default databases (via ADO connection string) and when I run the script I can see the database just fine.  My problem comes when I select channels and try to load selected data into the data portal.  A window pops up saying "Querying table 1 of 1.  Executing query..."  but immediately after that, a windows error window pops up with the following error message:

Error in <SQL Wizard.VBS>(Line: 29, Column: 3):

The following error occurred when executing the dialog box SQLBrowser from the SQL Wizard.SUD file:

 

<(Declerations), Line 403>

Type mismatch

Any thoughts?

0 Kudos
Message 5 of 10
(5,840 Views)

Hi All,

My next answer to this question is in the following post:

http://forums.ni.com/ni/board/message?board.id=60&message.id=7431

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 6 of 10
(5,831 Views)

Hi Brad,

How to use the "SQL Wizard" application? I have a sql 2005 DB and I would like to interact with him using Diadem... I saw the post and I downloaded the sql wizard but I am not able to add my DB to the other exemples... I add the following sentence ("DBs = AddDB(DBs, " VM            |          |          |          |    #    | " & AutoActPath & "VM_sist") at the line 12 of the sql wizard 101.vbs (VM_sist is my sistem DSN file) but I cannot see my db...

could you suggest me something?

thanks,

Michela 

0 Kudos
Message 7 of 10
(5,133 Views)

Hi Michela,

 

The file path option is only for Access *.mdb data base files, otherwise you have to provide the full ADO connection string in that spot-- this is what line 14 was trying to describe.  Here's what it should look like with your DSN:

 

DBs = AddDB(DBs, " dbDSN         |          |          |          |    #    | DSN=VM_sist;UID=_____;PWD=_____;")

 

You need to insert your actual user ID (UID) and password (PWD) values for your data base above.  If they happen to be empty, then you can use the following expression:

 

DBs = AddDB(DBs, " dbDSN         |          |          |          |    #    | DSN=VM_sist;UID=;PWD=;")

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 8 of 10
(5,114 Views)

Hi Brad,

Thanks so much for your reply!

 

I loaded my db in the wizard! Now I am able to see all the tables but not only, it loaded also all the constrains or other parameters as objects... Do you think it would be possible to excude them and visualize only tables?

 

Can you address me where to find a kind of user manual for the wizard?

Thanks in advance,

 

Michela 

0 Kudos
Message 9 of 10
(5,091 Views)

Hi Michela,

 

Excellent, I'm glad to hear you can now see your data base in the SQL Wizard.  Unfortunately, I never got around to documenting this application.  I'm puzzled by your statement that you loaded all the "contraints or other parameters as objects".  You can define query conditions (restraints) in the SQL Wizard yourself, but you can't load them into the SQL Wizard.  If you run a query that you've defined in the SQL Wizard, it will load the resulting records into data channels in a new Group in the Data Portal.  You can click on the "VIEW the loaded data set" button near the top left of the SQL Wizard to look at the loaded records in a VIEW table.

 

I think it would be best to continue this discussion over email-- feel free to contact me at brad.turpin@ni.com

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 10 of 10
(5,085 Views)