Page 1 of 1

Database types

Posted: Thu 30 Sep 2010 06:02
by oz8hp
I have defined
type
TDBType = (dbMySQL, dbMSSQL, dbSQLite, dbMSAccess);

const
arrDBProvider: array[TDBType] of string = ('MySQL', 'SQL Server', 'SQLite', 'Access') ;

But now I began wondering if there might be some type/const already defined that I could use. I haven't been able to find anything in manual or in the forum.

Posted: Thu 30 Sep 2010 11:10
by AlexP
Hello,

There is no such list of supported databases. However, you can use the following code to get the list of registered database providers:

var
lst: TList;
i: integer;
begin

lst:= UniProviders.LockList;
for i:= 0 to lst.Count -1 do
begin
ShowMessage(TUniProviderDesc(lst).ProviderName);
end;
end;

Posted: Thu 30 Sep 2010 13:28
by oz8hp
OK - will have a look to see what I can do with that

Posted: Fri 01 Oct 2010 06:08
by oz8hp
The purpose of my code is that I have made a generic databasesetup form and the type/const is used to allow me to decide the number of databasetype that the user can select in each of my apps.

It is all down to having as little work as possible :D