DBExpress connecting SQL 2008 at runtime with Delphi 2009
Posted
by Pascal
on Stack Overflow
See other posts from Stack Overflow
or by Pascal
Published on 2010-05-24T12:24:18Z
Indexed on
2010/05/27
17:41 UTC
Read the original article
Hit count: 671
Hi,
I'm trying to connect at runtime with SQL Server 2008 with Delphi 2009 using DBExpress, it it's not working. When I set all the properties at design time, it works great, but at RunTime, I'm getting "unknown driver: mssql". Below is the code:
scnConexao := TSQLConnection.Create(nil);
scnConexao.DriverName := 'MSSQL';
scnConexao.ConnectionName := 'MSSQLConnection';
scnConexao.GetDriverFunc := 'getSQLDriverMSSQL';
scnConexao.LibraryName := 'dbxmss.dll';
scnConexao.VendorLib := 'oledb';
scnConexao.LoginPrompt := False;
scnConexao.Params.Add('SchemaOverride=sa.dbo');
scnConexao.Params.Add('HostName=DESKTOP');
scnConexao.Params.Add('DataBase=DBNAME');
scnConexao.Params.Add('OS Authentication=False');
scnConexao.Params.Add('User_Name=UserName');
scnConexao.Params.Add('Password=Password');
scnConexao.Params.Add('MSSQL TransIsolation=ReadCommited');
scnConexao.Open;
I have included the dbxmss.dll in the same directory as my app, but to no avail. Any help would be greatly appreciated.
Tks
© Stack Overflow or respective owner