Subject Re: [firebird-support] Re: Error 335544721
Author Helen Borrie
At 07:40 AM 9/06/2008, you wrote:
>Hi thanks for the assistance. Herewith as much details as possible:
>
>Laptop
>
>Running Visual Studio 2008 where app is being developed
>Running FB client 2.5.0 Alpha 2
>OS: Win XP Prof.
>Firewall: ZoneAlarm
>
>Desktop
>
>IP address: 10.0.0.51
>Running FB server 2.0.4
>Security2.fdb located in c:\Program Files\Firebird\Firebird_2_0
>Application database “MyDatabase” located at e:\

---------------------------------
What is "drive e:\"?
---------------------------------

>OS: Win XP Prof.
>Firewall: ZoneAlarm

-------------------------------------------------------------------
Does ZoneAlarm know about your program?
-------------------------------------------------------------------

>Connection string being used (Being run from Laptop):
>
>Friend myCellCollection As New Collection
>Friend myConnection As New FbConnection
>Friend myDataAdapter() As FbDataAdapter
>Friend myDataSet As New DataSet
>Friend myWorkRow As DataRow
>
>Friend ServerType As FbServerType = FbServerType.Default
>Friend UserID As String = "sysdba"
>Friend Password As String = "masterkey"
>
>Friend DataSource As String = "10.0.0.51"
>Friend Database As String = "10.0.0.51:e:\\MyDatabase.fdb"
>
>Public Function OpenSQLConnection() As Boolean
>
> Try
> If myConnection.State = ConnectionState.Closed Then
> Dim cs As New FbConnectionStringBuilder()
>
> If Not ServerType = FbServerType.Embedded Then
> cs.Password = Password
> cs.UserID = UserID
> cs.Port = 3050
> End If
>
> cs.Pooling = False
> cs.DataSource = DataSource
> cs.Database = Database
> cs.Charset = "UNICODE_FSS"
> cs.ConnectionLifeTime = 30
> cs.ServerType = ServerType
>
> myDataSet.Locale = CultureInfo.InvariantCulture
> myConnection.ConnectionString = cs.ToString
>
> If cs IsNot Nothing Then cs = Nothing
> myConnection.Open()
> myDataSet.Reset()
> End If
> Return True
> Catch ex As Exception
> MessageBox.Show("An error has occured!" & vbCrLf & vbCrLf & _
> ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
> End
> Return False
> End Try
>
> End Function

---------------------------------------------------------------------------------------------------
You might like to consider the possibility that your program logic for
determining whether to submit user credentials is not bomb-proof.
For this, please use the firebird-net-provider list (subscribe at
http://firebirdsql.org/index.php?op=lists#fb-net-provider)

That, by the way, is a ^list moderator instruction...driver problems are
off-topic in firebird-support.
---------------------------------------------------------------------------------------------------
>
>When using the code as above the connection is made and I’m able to extract data from the database as required. As mentioned, I make use of SQL Manager Lite 2008 to work with the database. I have used this to add more users to the database. The new users were given the same grants etc.. as that displayed in SQL manager for sysdba.

---------------------------------------------------------------------------------------------------
You don't add users to the database, you add them to the server.
You assign *database privileges* to users. The database engine does
not prevent you from assigning privileges to users that don't exist.

1. Assigning a privilege to a non-existent user has no effect on anything
2. Assigning a database privilege to a user that does exist does
not give that user any access to the security database
3. Only SYSDBA has access to the security database and (from v.2
onwards) only via the Services Manager
-----------------------------------------------------------------------------------------------------
Also consider the possibility that you are using an old version of your
third-party DB tool that does not support the changes in Fb 2 and
above.
-----------------------------------------------------------------------------------------------------

>
>When I change the variables for the user and password in the code above I get the error 335544528 (I only got the 335544721 error once and never again).

-----------------------------------------------------------------------------------------------------
Neither of these errors is an authentication error.
Error 335544528 is "Unavailable database", for which there are
several possible causes. One of these is certainly attempting to
connect to a database on a partition or disk that is not physically
attached to the host machine and/or is being referred to by a drive
designator that is not the raw device designator.
This possibility has to be eliminated before all else.
-----------------------------------------------------------------------------------------------------

>
>This afternoon I went into SQL Manager and made a backup of the database. Afterwards I tried the different connections again (different user names) and both worked without any errors. Yesterdays problems seems to be something of the past now. I am however worried as | do not know what caused it in the first place.

-----------------------------------------------------------------------------------------------------
If it worries you then you need to keep exploring and find out whether
you can reproduce it.
-----------------------------------------------------------------------------------------------------

>
>I have tried the command line you have given me gsec ­display…etc to display the users but I get the following error: “no parameters allowed for this operation”.

-----------------------------------------------------------------------------------------------------
That message is not coming from Firebird or gsec.

However, AFAIR, the switch order might have caused a problem. However,
you should have seen a message from gsec, not a message from the
operating system (or perhaps from your firewall software). This kinda
reinforces the theory that the database access path is illegal and/or
the possibility that your server's firewall software is stepping in to block
access by the unknown client application.

For gsec the switch order does appear to be important - the v.2 version of
gsec seems to want the -user and -password switches FIRST and in that
order. The examples below were copy-pasted from my system a few
minutes ago (watch wrap):

(from the host server, dev1)

C:\Program Files\Firebird\Firebird_2_0\bin>gsec -user sysdba -password masterkey -database "dev1:c:\program files\firebird\firebird_2_0\security2.fdb" -display

user name uid gid full name
--------------------------------------------------------------------------------
----------
SYSDBA 0 0
REPL 0 0

C:\Program Files\Firebird\Firebird_2_0\bin>

(from a remote 2.0.4 client)

C:\Firebird2\bin>gsec -user sysdba -password masterkey -database "dev1:c:\program files\firebird\firebird_2_0\security2.fdb" -display
user name uid gid full name
--------------------------------------------------------------------------------
----------
SYSDBA 0 0
REPL 0 0

--------------------------------------------------------------------------------------------------------------------------

>
>I hope that the above can shed some more light on the problem I’ve had. As said it is now sorted but I would like to know why this happened. Also, if possible could you tell me whether there is a document with all the commands to use on the command line ?

--------------------------------------------------------------------------------------------------------------------------
With all of the command-line utilities, you can type <command-name> -help
In most cases you will get an error message telling you that -help
is an unsupported switch. That's fine, just keep reading, because the
utility will go on to provide you with (terse) help for using the command.

The "basics" of usage for these utilities can be found in the InterBase 6 beta
Operations Guide (OpGuide.pdf). You will find links for these docs in the
Documentation Index at the Firebird website. You should always use
these docs in combination with the successive Firebird release notes,
since many things have changed since July 2000.
--------------------------------------------------------------------------------------------------------------------------
There is also a book you can buy.... ;-)

./heLen