LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database connection with LabSQL

Thanks for everybody's methords.Thanks pawel.

hello JeremyL! I have some problems .

I found the ODBC.INI,but I do not know what should I do?

Can you give me a example? Thanks.

ying
0 Kudos
Message 11 of 21
(3,032 Views)
Hi Ying,

You want to use the Windows Registry VIs, which are found in the Advanced palette. I attached a small example of programmatically inserting a DSN entry for an Access Database. You'll probably have to modify it and change some settings to get the correct values entered for the registry keys. But the main idea is shown here. Hope this helps!
Jeremy L.
National Instruments
Message 12 of 21
(3,021 Views)
Hello jeremyL.

Thanks For your help!But I use LabView 6.1,

The example which you give me can not see.

can you give me a example which adapt to the Labview 6.1.

Thanks again.

ying.
0 Kudos
Message 13 of 21
(3,008 Views)
Sorry about that. Here you go.
Jeremy L.
National Instruments
0 Kudos
Message 14 of 21
(2,990 Views)
Hello Jeremy L.

Thanks for your example.

I use MSSQL Server ,and I modify the program .

the program can create the DSN after run it,

But ,in Connection String of the ADO Connection Open

what shoule I write then the program can connect with the database?

ying.
0 Kudos
Message 15 of 21
(2,976 Views)
Hi again.

I modify the program of "Create DSN Entry61.vi Diagram"

I modify the "value" of "Driver","FIL" and " DSNin"

in"write Registry value simple" .

The particular program can see the affix.

I modify the three modules,is the method all right?

can you give me some help?

I want to create DSN of the SQLServer.

Thanks.

ying.
0 Kudos
Message 16 of 21
(2,973 Views)
Hi,

I would recommend that you first create a System DSN manually by going through Control Panel >> Administrator Settings >> ODBC Data Sources. Set it up for a SQL Server connection, and then go back into your registry and see how the connection is divided up into registry keys. Then, go back to your VI and modify it to represent the same structure as you see with the sample SQL Server DSN. The way you currently have it may not work correctly due to the extra settings and keys you have, since it is set up for an Access database. Hope this helps!
Jeremy L.
National Instruments
Message 17 of 21
(2,965 Views)
Hello.

I can create a System DSN by going through Control Panel >> Administrator Settings >> ODBC Data Sources. and Set it up for a SQL Server connection. But in the different computer, I should do the same operation.

I mean can I build a program that contain the step which create a System DSN connect with SQLServer?

The example which you give can create a DSN for Access database.So, I think if modify necessaryly,it should create a System DSN for SQL server. the idea is all right?

What should I do ?

Thanks.

ying.
0 Kudos
Message 18 of 21
(2,956 Views)
Yes. What I was trying to show you was that if you create a System DSN manually, then you know what the different registry keys are, so you could then modify the example I gave you to connect to a SQL Server. The example has extra registry keys for Access. You do not need all these keys. Look at the DSN you made for SQL Server in the registry and then you'll know what keys are needed for SQL Server.
Jeremy L.
National Instruments
0 Kudos
Message 19 of 21
(2,942 Views)
Hello everyboday!

I build application which connection with SQLServer.
In addition, I want to build a subvi which can visit the database of the main program.
I mean the main program install the server,and the subvi install the clientserver.
then, the clientserver can visit the database which install the server.
I use the LabSQL of ADO Functions.what should I do?

Thans in advance.

ying.
0 Kudos
Message 20 of 21
(2,896 Views)