03-24-2010 02:12 AM
Hi
I am using SQL Server database. I am making connection with SQL by using UDL file. If I create Normal UDL file in windows and make connection it happens. I want to change or add some parameter Like database name. If I am changing this value by using labview, the file gets corrupted, and not able to make connection with SQL.
I want to create database by program. User should not create the database.
Kindly suggest me the proper solution.
Regards
Prabhakant Patil
prabhakantpatil@gmail.com
03-24-2010 02:28 AM
03-24-2010 04:15 AM
This Solution Wont help me Out. I dont want to Use ODBC, thats why I am using UDL and SQL server. When I use the UDL file it make connection with the SQL server. but the Thing is that if am editing the UDL file through Labview, then it gets corupted. so not able to make connection again.
Regards
Prabhakant Patil
03-24-2010 09:00 AM
If you look at the two files (i hope/assume you save to another file name while debugging) in notepad - are they similar, or is the corruption visible?
You should have a part with Data Source=[server]\[database], you didn't forget one part in the update?
/Y
03-24-2010 09:24 AM
I wouldn't try to change the UDL file using LabVIEW. What about creating different UDL files that your program can choose from? The other option would be to treat the UDL file as a pure text file, but that sounds like a lot of nasty parsing to me...
Try going to this thread for more info.
03-24-2010 09:38 AM - edited 03-24-2010 09:39 AM
It may look like a text file, but it's not a text file that uses plain-old ASCII. If you open it in Notepad you won't see anything obvious. You actually have to open the UDL file with a hex editor, and you will see the differences. Specifically:
Thus, if you absolutely must write out the file using LabVIEW you will need to write it out in binary mode, inserting the 0x00 bytes, and the FF FE at the start.