🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
5 messages
5 total messages Started by Vladimir Stefanovic Sun, 03 Jul 2005 21:33
Simple ADOQuery read problem on one machine...
#865
Author: Vladimir Stefanovic
Date: Sun, 03 Jul 2005 21:33
55 lines
2070 bytes
Hi,

This is the routine I use to check the DB version which I store
in a Table with only one record and only one filed.

This routine *is working* on maybe 500 machines, but I got
one report from which I concluded that this is the piece of
code that failed ( returned "").

The problematic OS was WinXP Home SP2.

Do you see what can go wrong in this routine to fail?
Can damaged MDAC can be the problem?
Can some system security settings be the reason?


AnsiString TDiMainForm::GetDBVer()
{
   AnsiString Ver = "";

   ADOQuery->Close();
   ADOQuery->SQL->Clear();
   ADOQuery->SQL->Add( "select top 1 * from TblVer" );

   AnsiString CS = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
                   ChangeFileExt( ParamStr(0), ".mdb" ) +
                   ";Mode=Read;Persist Security Info=False";

   ADOQuery->ConnectionString = CS;

   try
   {
      try
      {
         ADOQuery->Open();
         Ver = ADOQuery->FieldValues["Ver"];
      }
      catch ( const Exception &e )
      {
         // ...
      }
   }
   __finally
   {
      ADOQuery->Close();
   }
   return ( Ver );
}




-- 
Best regards,
Vladimir Stefanovic 
Re: Simple ADOQuery read problem on one machine...
#866
Author: Viatcheslav V. Vassiliev
Date: Mon, 04 Jul 2005 05:53
70 lines
2752 bytes
Is there any error message? Empty string will be returned if TblVer is 
empty.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + 
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Vladimir Stefanovic" <antivari@po.sbb.co.yu> �������/�������� � �������� 
���������: news:42c85997@newsgroups.borland.com...
> Hi,
>
> This is the routine I use to check the DB version which I store
> in a Table with only one record and only one filed.
>
> This routine *is working* on maybe 500 machines, but I got
> one report from which I concluded that this is the piece of
> code that failed ( returned "").
>
> The problematic OS was WinXP Home SP2.
>
> Do you see what can go wrong in this routine to fail?
> Can damaged MDAC can be the problem?
> Can some system security settings be the reason?
>
>
> AnsiString TDiMainForm::GetDBVer()
> {
>   AnsiString Ver = "";
>
>   ADOQuery->Close();
>   ADOQuery->SQL->Clear();
>   ADOQuery->SQL->Add( "select top 1 * from TblVer" );
>
>   AnsiString CS = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
>                   ChangeFileExt( ParamStr(0), ".mdb" ) +
>                   ";Mode=Read;Persist Security Info=False";
>
>   ADOQuery->ConnectionString = CS;
>
>   try
>   {
>      try
>      {
>         ADOQuery->Open();
>         Ver = ADOQuery->FieldValues["Ver"];
>      }
>      catch ( const Exception &e )
>      {
>         // ...
>      }
>   }
>   __finally
>   {
>      ADOQuery->Close();
>   }
>   return ( Ver );
> }
>
>
>
>
> -- 
> Best regards,
> Vladimir Stefanovic
> 
Re: Simple ADOQuery read problem on one machine...
#867
Author: Vladimir Stefanovic
Date: Mon, 04 Jul 2005 07:26
37 lines
2007 bytes
"Viatcheslav V. Vassiliev" wrote:

> Is there any error message?

No error message at user side, but that may be because
my code was with "try{}catch(){}". Can you please
suggest me how to cath & show the error in my catch
section, or with some other approach...

> Empty string will be returned if TblVer is empty.

It's checked - TblVer is *not* empty, it has a desired
value "2.0".

The user tried to install the MDAC 2.8 RTM but it said:

   <quote>
   MDAC 2.8 RTM is incompatible with this version of Windows.
   All of its features are currently part of Windows.
   [Close] [Details]
   </quote>

I think that's because of SP2 which is installed on user machine.

The user afterall thinks that's something with MDAC, because after
additional installation of MS ACCESS (wasn't previously installed)
the setup said something about problems with MDAC, but the
installation finished by [Ignore]-ing that part.

His MS Office works properly.




-- 
Best regards,
Vladimir Stefanovic
Re: Simple ADOQuery read problem on one machine...
#871
Author: Vladimir Stefanovic
Date: Mon, 04 Jul 2005 19:29
23 lines
1794 bytes
It seems that rare problems with ADO connection
comes from broken MDAC. On some forums I Googled
the say that on 100 machines comes 2-3 with broken MDAC.

The solution for XPSP1 is simple, just reinstalling MDAC,
and that costs 5.5MB of free download. But for XP SP2
there must be some workaround with 'mdac.ini', installation
disks, etc ... and that's too much pain for most users if they
must do that by themesleves.

These are some links that may be useful if someone is interested:

How to repair MDAC in XP SP2?
http://www.dbforums.com/archive/index.php/t-1050457.html

How to repair MDAC 2.8 on Windows XP with SP2 installed
http://www.macropool.com/en/download/mdac_xp_sp2.html



-- 
Best regards,
Vladimir Stefanovic 
Re: Simple ADOQuery read problem on one machine...
#874
Author: Viatcheslav V. Vassiliev
Date: Tue, 05 Jul 2005 10:03
58 lines
2957 bytes
You may show exception message with ShowMessage(e->Message) or 
Application->HandleException().

You can test MDAC with "MDAC checker" from 
http://www.microsoft.com/downloads/details.aspx?FamilyID=8f0a8df6-4a21-4b43-bf53-14332ef092c9&displaylang=en 
(or just Google for "MDAC checker").

Try also install latest Jet SP from http://www.microsoft.com/downloads.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + 
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Vladimir Stefanovic" <antivari@po.sbb.co.yu> �������/�������� � �������� 
���������: news:42c8e4b2$1@newsgroups.borland.com...
> "Viatcheslav V. Vassiliev" wrote:
>
>> Is there any error message?
>
> No error message at user side, but that may be because
> my code was with "try{}catch(){}". Can you please
> suggest me how to cath & show the error in my catch
> section, or with some other approach...
>
>> Empty string will be returned if TblVer is empty.
>
> It's checked - TblVer is *not* empty, it has a desired
> value "2.0".
>
> The user tried to install the MDAC 2.8 RTM but it said:
>
>   <quote>
>   MDAC 2.8 RTM is incompatible with this version of Windows.
>   All of its features are currently part of Windows.
>   [Close] [Details]
>   </quote>
>
> I think that's because of SP2 which is installed on user machine.
>
> The user afterall thinks that's something with MDAC, because after
> additional installation of MS ACCESS (wasn't previously installed)
> the setup said something about problems with MDAC, but the
> installation finished by [Ignore]-ing that part.
>
> His MS Office works properly.
>
>
>
>
> -- 
> Best regards,
> Vladimir Stefanovic
>
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads