LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding Server name

Hi All,

In my application i communicate with SQL database.

Now, we create DSN file for accessing table...We can create DSN file through labview also, what i want to know is, how to create it how can i find  SERVER name in labview itself.

This is how DSN file format is...

{

 

[ODBC]
DRIVER=SQL Server
UID=sa
DATABASE=TBP314
WSID=PI-1501I-C2016
APP=Microsoft Data Access Components
SERVER=PI-1501I-C2016

 

[ODBC]

DRIVER=SQL Server

UID=sa

DATABASE=TBP314

WSID=PI-1501I-C2016

APP=Microsoft Data Access Components

SERVER=PI-1501I-C2016

}

How can i find "BOLD" part in it in labview? I hope my question is clear to you all.

 

 

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 1 of 6
(3,196 Views)

Hello Gaurav;

 

I am not sure where you got that code, but i found out that It's not recommended to create databases on-the fly and to store all datasets in defferent tables. With Microsoft Acces and other databases, you can use relationships betweeen recordsets and tables to organize large amount of different types of data, which can be easily retrieved from one source.

 

To do so, you can find a set of instructions in the following link

http://digital.ni.com/public.nsf/allkb/151C96CC8EFAB6A786256CC2007C1178?OpenDocument

 

However if you want to dinamically create a database, you can either create a .udl file file in labview by using the open/create file function with a .udl extension. To configure the UDL properties you have to call the SDK for the MicrosoftHost Integration Server by using  .NET Assembly.

 

Another method of connecting to Access without using UDLs can be found in the following link

KnowledgeBase 2E7GIDDT: What Is the Difference between a System DSN, a User DSN, a File DSN, Univers...

 

I hope this information works for you!!

Good luck!

0 Kudos
Message 2 of 6
(3,136 Views)

Thanks MarisoIM for replying.

Second link provided by you will be helpful for me. But you did not answer my question exactly.

How can we find out SQL server name and Host name through labview?

Host name can be retrieved from Registry..But I do not know how...is it possible?

Thanks

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 3 of 6
(3,123 Views)

I was curious about this as well. I wrote a VI that reads the data provider from the connection properties from the Get Properties function.

 

It turns the connection string into a 2D array, and then finds the Data Source name from that. If you want to find out other information about the connection, like the data provider, user id, password, etc, you can do that too.

 

Right now I have it connect to a database using a udl, but I think you can just wire the connection information from any connection and use it like a subVI.

 

Hope this helps! Smiley Happy

0 Kudos
Message 4 of 6
(3,115 Views)

Hi,

Thanks for reply, but  i am not able to open this VI as i am using labview 8.5

Can you please save it again and post?

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 5 of 6
(3,076 Views)

This one should be saved in 8.5

0 Kudos
Message 6 of 6
(3,054 Views)