Page 1 of 1

Index based read/write in VB

Posted: Tue Jul 21, 2009 11:29 pm
by malinda
Hi

I need to read/write a file which I can access with idexes.
Using a database isn't required as it would be just a few settings.
Could you suggest me a method for this?

Thanks in advance,

Malinda

Re: Index based read/write in VB

Posted: Mon Aug 03, 2009 11:09 am
by eranda
Use following API to read/write settings to and from INI files

Code: Select all

Private Declare Function GetPrivateProfileString Lib "kernel32.dll" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long

Private Declare Function WritePrivateProfileString Lib "kernel32.dll" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long