01-08-2013 05:51 PM
Hi,
I'd like to create a SQL server data source programmatically in LabVIEW. The SQL server version I used is 2005. Can anyone give some ideas? A code example will be most favorable.
Thanks,
Jane
Solved! Go to Solution.
01-08-2013 09:47 PM
01-08-2013 10:29 PM
A system DSN...
01-09-2013 02:55 AM
You don't need a system DSN (.dsn or .udl file) to connect to a database.
Assuming you're using the DB Connectivity tooolkit, you can pass a connection string to DB Tools Open Connection.vi.
The connection string can directly contain the DB path, driver to use, credentials and other parameters.
Just create a connection string similar to the contents of a .udl file.
01-09-2013 03:45 AM
01-09-2013 03:46 AM
01-09-2013 07:48 AM
Here is the link I promised, it provides a lot of good discussion and information, as well as some very good drivers that don't need the DCT.
Mike...
01-09-2013 08:17 AM
You can build the connection string yourself. The Open function in the database toolkit accepts a string as well (it's polymorphic) which can be the connection string. This is the website I use to figure it out. Is has most common stuff. You may have to search Google some more for specific items.
http://www.connectionstrings.com/
If you want to use the other option, someone has made a UDL editor in LabVIEW. You can use this code to create your own UDL which the DB Open function can use:
https://decibel.ni.com/content/docs/DOC-18613
I have used the above code, so cannot comment on it.
01-09-2013 08:34 AM
That UDL editor is cool, but there is also one built into Windows.
Mike...
01-10-2013 04:43 AM
#4 is unnecessary if you have some decent text editor lite Textpad, Notepadd++ or similar installed, then you always have Edit it Notepad++ on the r-click menu. 🙂
/Y