Page 1 of 1

E: Range Check Error on SQLConnection.open

Posted: Tue 27 May 2008 13:34
by Goran
Hi!

We have some unique problem amongst our customers. This customer has Windows XP Pro SP2 O/S with Oracle database runnig for some their software and our software running on MSDE/MSSQL Server 2005 express software. Yestersday they reported that while starting our software, they get an error. I have tried many things including removing MSDE and since MSDE could not be installed, I installed MS SQLServer express SP2 today. Using Management Studio Express I had no problem browsing the database but our software still refuses to connect. Our software still uses dbexpsda30.dll version 3.10.8 (because newer versions have problems with ntext fields). I use BDS2006 Delphi.
This is the code, that is used to connect:

Code: Select all

function TdmSkupno.PoveziStreznik : Boolean;

  function PoveziSQL(var AMsg : String) : integer;
  begin
    AMsg := '';
    Result := -1;
    with sqlConn do
    try
      Logger(logTrail, 'trying to connect ' + glSkupno.NastZbirka.Server);
      Open; //  0 then
          Result := -10;
        if Pos('delay in opening server connection', LowerCase(AMsg)) >0  then
          Result := -10;
      end;
    end;
  end;

var
  iRez : Integer;
  sMsg : String;
begin
  with sqlConn do
  begin
    Close;
    ConnectionName := 'SQLServerConnection';
    DriverName := 'SQLServer';
    GetDriverFunc := 'getSQLDriverSQLServer';
    LibraryName := 'dbexpsda30.dll';
    VendorLib := 'sqloledb.dll';
    Params.Clear;
    Params.Add('BlobSize=-1');
    Params.Add('User_name=' + glSkupno.NastZbirka.Uporabnik);
    Params.Add('Password=' + glSkupno.NastZbirka.Geslo);
    Params.Add('Hostname=' + glSkupno.NastZbirka.Server); 
    Params.Add('DataBase=' + glSkupno.NastZbirka.Zbirka);
    Params.Add('LongStrings=True');
    Params.Add('EnableBCD=False');
    Params.Add('FetchAll=True');
//    Params.Add('UseUnicode=True');
    LoginPrompt := False;
    KeepConnection := True;
  end;

  sMsg := '';
  iRez := PoveziSQL(sMsg);
  if iRez = -10 then
  //timeout, trying to reconnect
    iRez := PoveziSql(sMsg);

  Result := iRez = 0;
  if not Result then
    MsgBox('An error has occured while connecting to the server.' + ^m +
           'The application will now exit.' + ^m +
           'Error:' + ^m + sMsg,
           'Error', mtError, [mbOK]);
end;
From all our installations, only on this computer the connection fails so something is wrong on this computer. Since I get only E: Range Check Error I am not sure where to search.
Does anybody have a clue where to search or what could be wrong?

Best regards,
Goran
Audax d.o.o.

Posted: Wed 28 May 2008 08:05
by Antaeus
You mean that your software was working on your customer's computer and then suddenly stopped working? If it is true, try to determine what changes on its computer led to this problem (software installation, Windows updates installation, etc.).
Does the problem appear when connecting to certain SQL Server or to anyone?

Posted: Wed 28 May 2008 09:04
by Goran
Antaeus wrote:You mean that your software was working on your customer's computer and then suddenly stopped working? If it is true, try to determine what changes on its computer led to this problem (software installation, Windows updates installation, etc.).
I am trying to establish this but You know... the response is "I didn't do anything, just maybe reading mail..."
Antaeus wrote:Does the problem appear when connecting to certain SQL Server or to anyone?
This customer has a laptop and the server with the application is on this computer. I hope they will bring the comp to us in the following days so I will try to connect to some other computer with the database.

Still, what is going on when the sql connection gets the request to open the connection to the database? Are there any internal listings that should be scanned, some for loops or something? Some tips in this direction could help me to check the settings and hopefully find the problem.

Best regards,
Goran

Posted: Fri 30 May 2008 06:49
by Goran
Just to let You know.
I've got the computer the other day and after disabling the Windows firewall it connected to any server except on the server on the computer. After setting up SQL Native Client on this computer and then setting back to the default values (as they were when comp came here), the connection to the server on the computer was successfully established.

Best regards,
Goran