Check the RN, the "Security" chapter.
--
Mgr. Jiří Činčura
Independent IT Specialist
On Wed, Feb 1, 2017, at 15:58, Daniele Barzotti wrote:
> Hi,
>
> I'm trying to create a \ connect to FB 3 embedded but I get a
> DbException:
>
> {System.Data.Common.DbException} =
> {"Missing security context for D:\\...path...\\RADIOS.FDB"}
>
> What I'm missing?
>
> My code is:
>
> var currentDirectory =
> Path.GetDirectoryName(GetCurrentProcess().MainModule.FileName-
> );
>
> string dbPath = Path.Combine(currentDirectory, "Radios.fdb");
>
> var connectionString = new FbConnectionStringBuilder
> {
> Database = dbPath,
> ServerType = FbServerType.Embedded,
> UserID = "sysdba",
> Password = "masterkey",
> ClientLibrary = "fbclient.dll"
> }.ToString();
>
> try
> {
> _Conn = new FbConnection();
> _Conn.ConnectionString = connectionString;
> _Conn.InfoMessage += _Conn_InfoMessage;
> _Conn.StateChange += _Conn_StateChange;
>
> if (!File.Exists(dbPath))
> {
> FbConnection.CreateDatabase(_Conn.ConnectionString);
> _Conn.Open();
>
> FbCommand cmd = new FbCommand(DbDefinition, _Conn);
> var tr = _Conn.BeginTransaction();
> cmd.ExecuteNonQuery();
> tr.Commit();
>
> }
> else
> _Conn.Open();
>
> LoadData();
> }
> catch (FbException fex)
> {
> _logger.Error(fex, "MainModel error");
> throw fex;
> }
> catch (Exception ex)
> {
> _logger.Error(ex, "MainModel error");
> throw ex;
> }
>
> ----------------------------------------------------------------------
> --------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Firebird-net-provider mailing list
> Firebird-net-provider@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider