Cannot change Jet Engine properties with a TADOConnection object

Hello everybody,

I'm asking your help about a problem that I have with TADOConnection and Jet Engine.
I found in this old post:

http://embarcadero.newsgroups.archived.at/public.delphi.database.ado/201108/1108022039.html

that it is possible to override the well-known problem of Jet Engine latency by changing the default value of the Jet Engine Page Timeout property.
Also more articles found on the web confirmed this and it is also recommended to change the default value of the Transaction Commit Mode property.

Then, following several delphi examples suggestions, I put these following two lines of code in my ADOConnection.AfterConnect event:

      MyADOConnection.Properties.Item['Jet Engine:Page Timeout'].Value:=500;
      MyADOConnection.Properties.Item['Jet OLEDB:Transaction Commit Mode'].Value:=1;

But unlikely, when the program executes, I get this error:

"Item cannot be found in the collection corresponding to the requested name or ordinal"

I didn't find anyone reporting a problem like this, so I wonder what could be the cause.

I set the ADOConnection property in this way:

   MyADOConnection.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+MyAccessDB+';Mode=ReadWrite;Persist Security Info=False;';
   MyADOConnection.Provider := 'Microsoft.Jet.OLEDB.4.0';
   MyADOConnection.LoginPrompt := False;
   MyADOConnection.ConnectionOptions := coAsyncConnect;
   MyADOConnection.Mode = cmReadWrite;

and I left default values for all other properties.

I am a Delphi XE3 user.

Thanks in advance to anyone that could give some help.

Regards,
Piero
0
PIERO
10/8/2014 5:17:55 PM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

2 Replies
676 Views

Similar Articles

[PageSpeed] 38

Piero,

On Wed, 08 Oct 2014 18:17:55 +0100, PIERO RONCOLETTA  wrote:

> Hello everybody,
>
> I'm asking your help about a problem that I have with TADOConnection and  
> Jet Engine.
> I found in this old post:
>
> http://embarcadero.newsgroups.archived.at/public.delphi.database.ado/201108/1108022039.html
>
> that it is possible to override the well-known problem of Jet Engine  
> latency by changing the default value of the Jet Engine Page Timeout  
> property.
> Also more articles found on the web confirmed this and it is also  
> recommended to change the default value of the Transaction Commit Mode  
> property.
>
> Then, following several delphi examples suggestions, I put these  
> following two lines of code in my ADOConnection.AfterConnect event:
>
>       MyADOConnection.Properties.Item['Jet Engine:Page  
> Timeout'].Value:=500;
>       MyADOConnection.Properties.Item['Jet OLEDB:Transaction Commit  
> Mode'].Value:=1;

While I'm not sure about that "Page Timeout", this code does work for me  
in D2006 to change the "TransactiomCommitMode"...

{code}
     procedure  Set_ConnectionProperties_dbeJet ;
     const
       cTransactionCommitMode = 'Jet OLEDB:Transaction Commit Mode' ;
     begin
       if  not G_HaveSetConnectionProperties  then begin

         with  fSasAdoConnection.Internal_ConnectionObject  do begin

        // Any second-time-round creation throws an exception here...
        // 'Item cannot be found in the collection corresponding to the  
requested name or ordinal'

           Properties.Item [cTransactionCommitMode].Value := 1 ;

          {===   // Suggested additions to retry after locking errors
           Properties.Item ['Jet OLEDB:Lock Delay'].Value := 10;
           Properties.Item ['Jet OLEDB:Lock Retry'].Value := 10;
          ===}
         end ;

         G_HaveSetConnectionProperties := true ;
       end ;
     end ;
{code}


You say...

> when the program executes, I get this error:
>"Item cannot be found in the collection corresponding to the requested  
> name or ordinal"

Note that comment about "second-time-round creation". I'm sorry that I  
cannot remember (it was more than 6 years ago!) whether my comment refers  
to an error when trying to set the TransactionCommitMode more than once  
for the /same/ ConnectionObject or trying to set CommitMode on two or more  
ConnectionObjects within the same program

The presence of that global flag "G_HaveSetConnectionProperties" would  
seem to suggest that it's the second case - ie. I could only set  
CommitMode once and then only for one ConnectionObject.

(but again, this is D2006. Things may have changed since then - or, given  
past experience, probably not!)

Hope at lest some of that helps

-- 
Paul
0
Paul
10/9/2014 9:46:14 AM
Paul,

thank you very much, your solution works fine!
In effect, there are two differences with respect to my code:

1) You set:

MyADOConnection.ConnectionObject.Properties.Item['Jet OLEDB:Transaction Commit Mode'].Value:=1;

while I had:

MyADOConnection.Properties.Item['Jet OLEDB:Transaction Commit Mode'].Value:=1;

2) I put my code in the MyADOConnection.AfterConnect event. This not works.
Instead, defining a separate procedure

Set_ConnectionProperties_dbeJet ;

and calling it just after setting 

MyADOConnection.Connected:=true 

works fine. Setting the Jet OLEDB:Page Timeout property works too.
I don't know why such different behaviour, anyway now it works and this is ok for me!

Thank you again
Regards
Piero

> {quote:title=Paul Scott wrote:}{quote}
> Piero,
> 
> On Wed, 08 Oct 2014 18:17:55 +0100, PIERO RONCOLETTA  wrote:
> 
> > Hello everybody,
> >
> > I'm asking your help about a problem that I have with TADOConnection and  
> > Jet Engine.
> > I found in this old post:
> >
> > http://embarcadero.newsgroups.archived.at/public.delphi.database.ado/201108/1108022039.html
> >
> > that it is possible to override the well-known problem of Jet Engine  
> > latency by changing the default value of the Jet Engine Page Timeout  
> > property.
> > Also more articles found on the web confirmed this and it is also  
> > recommended to change the default value of the Transaction Commit Mode  
> > property.
> >
> > Then, following several delphi examples suggestions, I put these  
> > following two lines of code in my ADOConnection.AfterConnect event:
> >
> >       MyADOConnection.Properties.Item['Jet Engine:Page  
> > Timeout'].Value:=500;
> >       MyADOConnection.Properties.Item['Jet OLEDB:Transaction Commit  
> > Mode'].Value:=1;
> 
> While I'm not sure about that "Page Timeout", this code does work for me  
> in D2006 to change the "TransactiomCommitMode"...
> 
> {code}
>      procedure  Set_ConnectionProperties_dbeJet ;
>      const
>        cTransactionCommitMode = 'Jet OLEDB:Transaction Commit Mode' ;
>      begin
>        if  not G_HaveSetConnectionProperties  then begin
> 
>          with  fSasAdoConnection.Internal_ConnectionObject  do begin
> 
>         // Any second-time-round creation throws an exception here...
>         // 'Item cannot be found in the collection corresponding to the  
> requested name or ordinal'
> 
>            Properties.Item [cTransactionCommitMode].Value := 1 ;
> 
>           {===   // Suggested additions to retry after locking errors
>            Properties.Item ['Jet OLEDB:Lock Delay'].Value := 10;
>            Properties.Item ['Jet OLEDB:Lock Retry'].Value := 10;
>           ===}
>          end ;
> 
>          G_HaveSetConnectionProperties := true ;
>        end ;
>      end ;
> {code}
> 
> 
> You say...
> 
> > when the program executes, I get this error:
> >"Item cannot be found in the collection corresponding to the requested  
> > name or ordinal"
> 
> Note that comment about "second-time-round creation". I'm sorry that I  
> cannot remember (it was more than 6 years ago!) whether my comment refers  
> to an error when trying to set the TransactionCommitMode more than once  
> for the /same/ ConnectionObject or trying to set CommitMode on two or more  
> ConnectionObjects within the same program
> 
> The presence of that global flag "G_HaveSetConnectionProperties" would  
> seem to suggest that it's the second case - ie. I could only set  
> CommitMode once and then only for one ConnectionObject.
> 
> (but again, this is D2006. Things may have changed since then - or, given  
> past experience, probably not!)
> 
> Hope at lest some of that helps
> 
> -- 
> Paul
0
PIERO
10/9/2014 1:23:59 PM
Reply:

Similar Artilces:

text box object changes size when a property is changed
Every time I change a property for a text box object, ie.e fon or text displayed, the text box changes to its original size and I must resize the object. Is there a way to prevent this from happening? I am using Infomaker 6.5.1. Thanks, Drives me crazy too, bu there is nothing you can do about it. Works the same in version 7 as well. -- Terry Dykstra (TeamSybase) Canadian Forest Oil Ltd. Check out Sybase Developer's Network: http://www.sybase.com/sdn Jane Johnson <jjohnson@doh.state.ut.us> wrote in message news:38972539.74B7B8D6@doh.state.ut.us... > Every ...

Objects and properties of properties
Okay, this should be an easy object oriented C# question, but for some reason I have been unable to find the answer yet. I am creating an object of my own called JAddress. And basically I want to be able to do the following: JAddress.ZipCode.Text JAddress.ZipCode.MyId I am unsure on how to create the second level of properties! Doing only a first level is really easy.....public string ZipCode { get { return m_ZipCode; } set { m_ZipCode = value; } }Does anyone know how to do this? Thanks in advance, csdietrich You would have its own ZipCode type (class) which...

Convert Delphi 5 ADO App to Delphi 2007 ADO.NET
I have an appliction tha that is writen in Delphi 5 with ADOConnetion, ADOTable, and ADOQuery components. I need to upgrade to Delphi 2007 and use ADO.NET. I have the program building in with Delphi 2007. Is there anything I need to do to convert the ADO to ADO.NET? > I need to upgrade to Delphi 2007 and use ADO.NET. Why ? -- With best regards, Dmitry Arefiev AnyDAC (www.anydac.com) - Oracle, MS SQL Server, IBM DB2, MySQL, Firebird, Interbase, PostgreSQL, Sybase ASA, SQLite, MS Access, DBX, ODBC, InMem - universal high-speed native data access engine Reasons for ...

Problem changing properties of graph object
When I change the graph type of a graph object to 'pie' within a script. The graph changes ok, however, the pie slice labels defaults to the categories. I have tried using the following line: ls_rc = dw_1.Modify ("gr_dw_1.pie.DispAttr.DisplayExpression = 'if(seriescount > 1, series,string(percentofseries,"0.00%"))' "). It does display correctly if I manually change the type of graph within the datawindow painter and change the graph type to anything else and change it back.. Please help ...

Crosstab:How to change text object properties.
--------------B10CA33C67B4D7FA9E8EAC07 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I have a text objeject in a header band of my crosstab datawindow. I need to change the width of this object dynamicaly. But the problem is that in the source code there is no name property for text object (see below). How to change the width of this text object from '613'(in blue) to '242'? text(band=header[3] alignment="0" text="@ocrn_day_txt"border="6" color="0" x="361" y="4" height=&qu...

Event for change of State property on TADOConnection
Hello, Despite looking all around, I could not find an event I can plug into to get the information that the State property of TADOConnection is about to change (or has just changed, does not matter much). It seems possible in CSharp, but I could not find it in Delphi (2010) Has anyone got any hint on that subject? Regards Olivier ...

how do I change an objects properties when stored as a session
Ok I have an employee object that I want to store in a Session variable: Session("myEmployee") = New myNs.employee() how do I go about changing the properties or calling methods from this object once its in a Session? set property guess: Session("myEmployee").firstName = "Darin" get property guess: myVar = Session("myEmployee").firstName call method guess: boolSuccess = Session("myEmployee").makeAngry("byPestering") You'd take a local reference to it, which you take by casting the object from session variable into the type (employee). For example: ...

Is it possible to watch an object for a change to any property?
For years, I've wondered if there was some way to detect when a user tried to change, remove or define a property of an object, regardless of what the property name was. Given an object: var a = { b: {d: 3} } I'd really love to be able to say something like: a.watch('*', function watcher(id, oldVal, newVal) { return this.doSomething(id, oldVal, newVal) ? newVal : oldVal }); The watcher function would be called if I tried to set a.c to 6, or to remove or change a.b. It would not be called if I tried to set a.b.c. This would be useful for arrays (and...

how to change the properties of multi computer objects in once
Hi, everyone; In my datawindow, there are more than a hundred computer objects. I need change the display format. Is there a way I can change them all in once? Could you let me know how if there is. Export the object. Reopen it in a text editor and do a search and replace on the desired attribute. Then reimport the object. Randy Hao wrote: > Hi, everyone; > > In my datawindow, there are more than a hundred computer objects. I need > change the display format. Is there a way I can change them all in once? > Could you let me know how if there is. ...

Bulk
Does anybody know how I can specify OS version requirements on all the application objects in a container. I can do it one by one but there are lots. I've got another container with all newly packaged applications for windows xp, and during the rollout, I want users to be able to log in to xp machines and get the xp applications only, or if they log into the older machines, they can get only the older apps. Is there anyway of scripting property changes for objects? Regards, Hans On Wed, 28 Jul 2004 03:56:00 GMT, Hans McKay wrote: > Does anybody know how I can s...

changing nested report object properties
Hello, I have built, with PB8 a base DW with a nested report in its summary band. I am trying to access some properties for the nested some of the control of the nested report and following PB help and using dot notation for accessing DW properties I use the following expresion: dw_1.Object.uproc_dw.object.compute_1.visible where dw_1 is the base DW and uproc_dw is the nested report. PB help tell something about defining a row number (it must be the last one) in the nested report but I do not understand what I should do. Thanks, PB help says : "each instance of the rep...

Add event handler to an object for when a property changes
I've been searching around, but have not found anyone doing what I'm trying to do.  I would like to know when a property on an instantiated object changes, but the object does not raise an event when this property changes.  I do not have access to the object to add any additional events.  I have access to an "addHandler" event on the object, however. So is there a way to add a new event to the property I'm looking for to know when it has changed?  Or is there some other way to be notified when this property changes? Thanks!  -Craig...

The Microsoft Jet database engine could not find the object
try to use code below to access the .xls file, got a error. "The Microsoft Jet database engine could not find the object 'DriverDistanceData'.      Make sure the object exists and that you spell its name and the path name correctly" I know the error from line 1. I tried a lot ways in line 1, but didn't work protected void BtloadData_Click(object sender, EventArgs e)        {            string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Sou...

Problems with Jet Database engine after changing computer
Hi, I have a project that was roking just perfect, it has this code for passing data from an Excel file to SQL 2000. I recently changed my computer and I got XP (I developed this with win2k) I had to install everything from scratch, SQL, IIS, .NET, etc. now I'm getting this error when trying to use it: The Microsoft Jet database engine could not find the object 'Sheet1'. Make sure the object exists and that you spell its name and the path name correctly. Any ideas? Should I install some SP or something like that??? Thanks, Marcela //*************************************...

Web resources about - Cannot change Jet Engine properties with a TADOConnection object - embarcadero.delphi.ado

Resources last updated: 12/3/2015 8:10:15 PM