Hi i posted an earlier message todag and ask how to access an .ini file select a string from it an use that to open a database
well Peet send me the following code (many thanks) but i stil have a question.

==============================================
Option Explicit
Private Declare Function GetPrivateProfileString _
Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal _
lpApplicationName As String, ByVal lpKeyName As String, _
ByVal lpDefault As String, ByVal lpReturnedString As _
String, ByVal nSize As Long, ByVal lpFileName As String) As _
Long

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

Private Function ReadINI(strsection As String, strkey As String, strfullpath As String) As String
Dim strbuffer As String
Let strbuffer$ = String$(750, Chr$(0&))
Let ReadINI$ = Left$(strbuffer$, GetPrivateProfileString(strsection$, ByVal LCase$(strkey$), "", strbuffer, Len(strbuffer), strfullpath$))
End Function

Private Sub WriteINI(strsection As String, strkey As String, strkeyvalue As String, strfullpath As String)
Call WritePrivateProfileString(strsection$, UCase$(strkey$), strkeyvalue$, strfullpath$)
End Sub

Private Sub Command1_Click()
WriteINI "DBParam", "DBName", "C:\myapp\db\mydb.mdb", "C:\TEST.INI"
WriteINI "Temp", "TMPPath", "C:\myapp\tmp", "C:\TEST.INI"
End Sub

Private Sub Command2_Click()
MsgBox ReadINI("DBParam", "DBName", "C:\TEST.INI")
MsgBox ReadINI("Temp", "TMPPath", "C:\TEST.INI")
End Sub
==============================================

Well this code selects from the ini file a section [DBParam] a key "DBName" and a path of a database. So the ini file will look like this

[DBParam]
DBName=C:\myapp\db\mydb.mdb
[Temp]
TMPPath=C:\myapp\tmp

Ok so far so good

Now my ini file look a little bit different
example:

[Open database]
\\BJ2046\Databases\Databases\image.ald=Image Database
\\BJ2046\Bart\Test\Databases\odbc.ald=ODBC Demo Database

So i can't select the key because their isn't one. I just what to select the following string "\\BJ2046\Databases\Databases\"

Ok well i have a combo box that connect to odbc. So in the combo box i can select the name of the database (like: Image and odbc)

So what I what to do is, when i select a database in the combo box and press a button ("ok") the database must be opened in an alchemy viewer (not of importance at this moment)

Everything seems working correct like, connecting to odbc and opening the viewer, but the viewer isn't referencing to the correct path (adress). This because the ini file changes very often so i cant say:

Dim DB As Alchemy.Database
Set DB = au.Databases.Add("\\BJ2046\Databases\Databases\" & combobox.text & "*.ald")

because then i can't open the odbc database but only the image database

Ok well finaly here is my REAL question:
How can i use the Read.INI function (without the key) to select the path. So when i select "odbc" it has to use
\\BJ2046\Bart\Test\Databases\ as path and when i select
"image" it has to use \\BJ2046\Databases\Databases\ as path.

Many thanks

Bart