06-26-2010 09:36 AM
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
}
How can i find "BOLD" part in it in labview? I hope my question is clear to you all.
07-06-2010 05:58 PM
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
I hope this information works for you!!
Good luck!
07-07-2010 08:11 AM
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
07-07-2010 08:37 AM
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!
07-11-2010 06:02 AM
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?
07-12-2010 04:54 PM
This one should be saved in 8.5