Connect to database via FileDSN in Delphi

658 views Asked by At

I am trying to connect my TDatabase object to ODBC via FileDSN in Delphi5. I already created a DSN file and it works very fine when connecting to it via C# or VB6.

For example, the syntax in C# is:

private string GetConnectionString(string fileDSNPath, string userName, string password)
    {
        return string.Format("ODBC;DATABASE=library;FILEDSN={0};UID={1};PWD={2};ALLOWUNSCHAR=0;", fileDSNPath, userName, password);
    }

Using Delphi 5 IDE, I tried to define TParams but it doesn't work: TParams: FILEDSN=[my DSN file path]

enter image description here

I am getting the error:

"Unknown Database. Alias: db"

0

There are 0 answers