# GetPrivateProfileString having a problem



## saraj81 (Aug 11, 2004)

the problem is this
i inherited this code from an experienced programmer and i am not
this code works for all the other reports used in he program just not this one so help please!!!
the following is the code used
this is in one sub

StrTemp = Read_Ini("Template File", "FileName", Str_Reports_Path & RFile)

Str_Reports_Path & RFile = "C:\Folder Name\FileName.vpt"
str_filename = Str_Reports_Path & RFile

and is read to the following

 lg_return = GetPrivateProfileString(Str_Section, Str_Entry, "*NOTHING*", Str_Buffer, 255, str_filename)
Str_Value = Left$(Str_Buffer, lg_return)

Str_Buffer should = "C:\Folder Name\FileName.tpl"
but it contains this "C:\Folder Name\*NOTHING*"

this as you may guess throws an error
regards
saraj


----------



## saraj81 (Aug 11, 2004)

thanks everyone who looked at the problem for me but i found a solution
here it is for anyone else who may need it now or in the future
the problem was in the ini file not the code
the ini file was pointing towards the wrong file it was like this
C:\folder name\*NOTHING*.tpl
where it should have been
C:\folder name\filename.tpl
hope this helps someone else


----------

