NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

ini files for constants

Hi,

I would like to use an ini-file for some database information (like user, database name etc.). Want I want to do is when I build the SQL connection string to the database to take this information out of the ini-file just like the use of language resource files.

Example:
"Provider=MSDAORA.1;Password=" + ResStr("ORACLE"; "Password") + ";User ID=" + ResStr("ORACLE"; "User") + ";Data Source=" + ResStr("ORACLE"; "Database") + ";Persist Security Info=True"

To get this one working I have to place the ini-file into the language directory. As this has nothing to do with language I would like to have it in some other directory.
Any suggestions???

Best regards
Steffen
0 Kudos
Message 1 of 6
(3,570 Views)
hi Steffen,

the only thing 'bout that I could find is this thread.
sorry, but perhaps someone else knows a way though this...

greets!
0 Kudos
Message 2 of 6
(3,560 Views)
Hi,

There was an example on NI website, a few years ago, for a sequence file using the DLL adapter step type calling a windows kernel32.dll to read data from an INI. I have had a look on the NI website, but unfortunately I haven't been able to find the example.

It makes calls to functions such as GetPrivateSectionName() and GetPrivateProfileString().

I may still have that example, but it may take some digging on CD's, to find it.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 3 of 6
(3,556 Views)
Hi Ray,

I'll appreciate it very much if you could find the example!

Regards
Steffen
0 Kudos
Message 4 of 6
(3,555 Views)
Hi,

Attached is an example, its not the one I obtained from the NI website, I'm still looking for that. This one I must have developed while trying things out.

Hope it helps

Regards
Ray Farmer

reason for edit: forget to attach example

Message Edited by Ray Farmer on 06-22-2005 09:54 PM

Regards
Ray Farmer
0 Kudos
Message 5 of 6
(3,534 Views)
Hi,

Found the example.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 6 of 6
(3,528 Views)