Win2K and VB-apps using ADO, -Strange behavior


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 9 of 9

Thread: Win2K and VB-apps using ADO, -Strange behavior

  1. #1
    Bernie Guest

    Win2K and VB-apps using ADO, -Strange behavior


    Hi

    Have some problem when running a VB-app using ADO and Microsoft Jet OLEDB
    4.0 in Win2K. Sometimes a recordset opened doesn't retrive any records, although
    it should, and no error is returned. Both BOF and EOF is set to True.

    It seems to happen more or less randomly and especially when running over
    a network. When the database is placed localy it works OK. When running on
    Win9X and NT4 it works fine.

    I have tried ADO2.5 and 2.6 as well as Win2K without and with servicepacks
    and there is no difference in behaviour.

    Anyone familiar with this?

    Bernie

  2. #2
    Miroslav St. Jeliaskoff Guest

    Re: Win2K and VB-apps using ADO, -Strange behavior

    Can you post your connection string, if you use such. I
    think there is the key to your problem. And of course
    posting here more code will help too.
    Is there somebody else using the table at the same time?

    Miroslav St. Jeliaskoff

    "Bernie" <magnus.bernroth@rejlers.se> wrote in message
    news:3bbd7f98$1@news.devx.com...
    >
    > Hi
    >
    > Have some problem when running a VB-app using ADO and

    Microsoft Jet OLEDB
    > 4.0 in Win2K. Sometimes a recordset opened doesn't retrive

    any records, although
    > it should, and no error is returned. Both BOF and EOF is

    set to True.
    >
    > It seems to happen more or less randomly and especially

    when running over
    > a network. When the database is placed localy it works OK.

    When running on
    > Win9X and NT4 it works fine.
    >
    > I have tried ADO2.5 and 2.6 as well as Win2K without and

    with servicepacks
    > and there is no difference in behaviour.
    >
    > Anyone familiar with this?
    >
    > Bernie






  3. #3
    Bernie Guest

    Re: Win2K and VB-apps using ADO, -Strange behavior


    Hi,
    When trying to resolve this only one app is using the database. Connection
    string looks like this;

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Tyr\Testenv\DB\Test.mdb;Jet
    OLEDB:System database=\\Tyr\Testenv\DB\Test.mdw;Persist Security Info=True;User
    ID=scott;Password=tiger"

    We always use UNC style for the paths but have also tried to use the local
    mapping with no change in behavior. For the moment we havn't tried to change
    the internal order of the elements of the connection string.

    The strange thing is that it seems to occur only when using a SELECT with
    the Max() function and the LIKE predicate. At least we havn't been able to
    reproduce the behavior with a simplier query (yet).

    The query looks like this;

    SELECT Max(Items.ID) AS MaxID FROM Items
    WHERE Items.ID Like 'AB-######'

    Table Items contains several hundred records but not all of them matches
    the criteria. When putting the DB locally it works almost 100% (yeah, we
    have had a few errors here as well, but not as often).

    The Win2K machine is completely clean, -No antivirus apps or office or mailprograms
    have ever been near it. As lean as it possibly could be... And as I said
    before, -It never happens on Win9X or NT4.

    Any clues???

    Bernie


    "Miroslav St. Jeliaskoff" <miroslav@earthling.net> wrote:
    >Can you post your connection string, if you use such. I
    >think there is the key to your problem. And of course
    >posting here more code will help too.
    >Is there somebody else using the table at the same time?
    >
    >Miroslav St. Jeliaskoff
    >
    >"Bernie" <magnus.bernroth@rejlers.se> wrote in message
    >news:3bbd7f98$1@news.devx.com...
    >>
    >> Hi
    >>
    >> Have some problem when running a VB-app using ADO and

    >Microsoft Jet OLEDB
    >> 4.0 in Win2K. Sometimes a recordset opened doesn't retrive

    >any records, although
    >> it should, and no error is returned. Both BOF and EOF is

    >set to True.
    >>
    >> It seems to happen more or less randomly and especially

    >when running over
    >> a network. When the database is placed localy it works OK.

    >When running on
    >> Win9X and NT4 it works fine.
    >>
    >> I have tried ADO2.5 and 2.6 as well as Win2K without and

    >with servicepacks
    >> and there is no difference in behaviour.
    >>
    >> Anyone familiar with this?
    >>
    >> Bernie

    >
    >
    >
    >



  4. #4
    huibert Guest

    Re: Win2K and VB-apps using ADO, -Strange behavior


    As you said in your last post yourself, it makes no difference whether the
    data is local or somewhere on the network. This clearly indicates that other
    factors are at play. Make sure you have the same set of drivers on all machines.

    >SELECT Max(Items.ID) AS MaxID FROM Items
    >WHERE Items.ID Like 'AB-######'


    I have never seen the # used as a wildcard character. Does # stand for any
    single character?

    Try to see if the following statement works:

    SELECT Max(Items.ID) AS MaxID FROM Items
    WHERE Items.ID Like 'AB-%'

    It means: find any string starting with AB- followed by 0 or more other characters.
    This may not be exactly what you want, but if this works, you know that your
    problem lies in the use of #.

    BTW: when a query does not yield results, you get no error. .EOF and .BOF
    will be true.


  5. #5
    Bernie Guest

    Re: Win2K and VB-apps using ADO, -Strange behavior


    Hi,
    It makes a difference whether DB is locally or somewhere on the network in
    such way that it fails very rarely when placed locally but more often when
    the LAN is involved.

    The '#' in the like pattern means any numerical character on Access DB:s
    similar with '[0-9]' for SQL-server. First I was confused if this 'Access-style
    SQL' should work on ADO since '*' and '?' don't and must be replaced with
    '%' and '_' but we have been using it successfully for a long time now. And
    the strange thing is why it works/not work randomly. If there is an error
    in the syntax it would be so all the time, would it not?

    By the way this is only one of the problems that have occured when running
    the app on win2K. A bunch of other strange phenomenon like frozen processes,
    keyboard lockups and more are one the agenda for the moment...

    Bernie

    "huibert" <hvandeursen@wanadoo.nl> wrote:
    >
    >As you said in your last post yourself, it makes no difference whether the
    >data is local or somewhere on the network. This clearly indicates that other
    >factors are at play. Make sure you have the same set of drivers on all machines.
    >
    >>SELECT Max(Items.ID) AS MaxID FROM Items
    >>WHERE Items.ID Like 'AB-######'

    >
    >I have never seen the # used as a wildcard character. Does # stand for any
    >single character?
    >
    >Try to see if the following statement works:
    >
    >SELECT Max(Items.ID) AS MaxID FROM Items
    >WHERE Items.ID Like 'AB-%'
    >
    >It means: find any string starting with AB- followed by 0 or more other

    characters.
    >This may not be exactly what you want, but if this works, you know that

    your
    >problem lies in the use of #.
    >
    >BTW: when a query does not yield results, you get no error. .EOF and .BOF
    >will be true.
    >



  6. #6
    Miroslav St. Jeliaskoff Guest

    Re: Win2K and VB-apps using ADO, -Strange behavior

    To be honest, Bernie, I'm stuck here - no ideas.
    BUT it looks to me as some setting on the "server" is giving
    the problem.
    What type is the field Items.ID? Is it "Text" type?
    Some settings from the Regional Settings applet in the
    Control panel may do the harm. Or if the field in the DB
    file has a "Format" property set to something.
    Try to play with these things a little.

    I don't think the order in the connection string is wrong or
    in any dependency with the results. But maybe you should try
    to shorten it and play with a simpler DB file just to catch
    the problem.

    Apologizing for not giving you any specific solution,
    Miroslav St. Jeliaskoff

    P.S. Post this question to the DB newsgroup if here nobody
    answers you soon!



  7. #7
    huibert Guest

    Re: Win2K and VB-apps using ADO, -Strange behavior


    "Bernie" <magnus.bernroth@rejlers.se> wrote:
    >
    >Hi,
    >It makes a difference whether DB is locally or somewhere on the network

    in
    >such way that it fails very rarely when placed locally but more often when
    >the LAN is involved.


    What I meant is that errors *DO* occur in both cases, local or network.
    This means the network cannot be the cause of the error.
    You don't indicate to us whether or not you have ran *exactly* the same query
    in both cases, so the difference in frequency of the errors could
    still be explained away by a non-systematic approach in your testing.
    Look at your data and your query very carefully in the cases where
    it fails. I'm sure you'll notice a pattern there.

    >The '#' in the like pattern means any numerical character on Access DB:s
    >similar with '[0-9]' for SQL-server. First I was confused if this 'Access-style
    >SQL' should work on ADO since '*' and '?' don't and must be replaced with
    >'%' and '_' but we have been using it successfully for a long time now.

    And
    >the strange thing is why it works/not work randomly. If there is an error
    >in the syntax it would be so all the time, would it not?


    There is no error in the syntax, since this would cause an error-message.
    Successfully? You've got a case on your hands where the the LIKE operator
    is still a suspect that has not been ruled out. The 'randomness' can still
    be explained by unsystematic testing.
    If you want to prove that network conditions are the cause of this problem
    you have to repeat a query of which you know that it should return results.
    Repeat it dozens of times. If this query is not always succesful then, and
    only then, you can blame the network.

    >By the way this is only one of the problems that have occured when running
    >the app on win2K. A bunch of other strange phenomenon like frozen processes,
    >keyboard lockups and more are one the agenda for the moment...


    You keep on coming with surprises. Do your testing on a stable machine.

    hth
    huibert

  8. #8
    Bernie Guest

    Re: Win2K and VB-apps using ADO, -Strange behavior


    Hi,

    I think we're on it now! It seems to be the MSJETOLEDB40.DLL. Ver 4.00.2927.2
    handles it OK but 4.00.3441.4 needs the '[0-9]' style to work properly. When
    using '#' this random behaviour occurs. Since there are a number of dependencies
    we aren't finished yet.

    I'll keep you posted...

    (Isn't the world of computers wonderful??)

    Regards

    Bernie


    "huibert" <hvandeursen@wanadoo.nl> wrote:
    >
    >"Bernie" <magnus.bernroth@rejlers.se> wrote:
    >>
    >>Hi,
    >>It makes a difference whether DB is locally or somewhere on the network

    >in
    >>such way that it fails very rarely when placed locally but more often when
    >>the LAN is involved.

    >
    >What I meant is that errors *DO* occur in both cases, local or network.
    >This means the network cannot be the cause of the error.
    >You don't indicate to us whether or not you have ran *exactly* the same

    query
    >in both cases, so the difference in frequency of the errors could
    >still be explained away by a non-systematic approach in your testing.
    >Look at your data and your query very carefully in the cases where
    >it fails. I'm sure you'll notice a pattern there.
    >
    >>The '#' in the like pattern means any numerical character on Access DB:s
    >>similar with '[0-9]' for SQL-server. First I was confused if this 'Access-style
    >>SQL' should work on ADO since '*' and '?' don't and must be replaced with
    >>'%' and '_' but we have been using it successfully for a long time now.

    >And
    >>the strange thing is why it works/not work randomly. If there is an error
    >>in the syntax it would be so all the time, would it not?

    >
    >There is no error in the syntax, since this would cause an error-message.
    >Successfully? You've got a case on your hands where the the LIKE operator
    >is still a suspect that has not been ruled out. The 'randomness' can still
    >be explained by unsystematic testing.
    >If you want to prove that network conditions are the cause of this problem
    >you have to repeat a query of which you know that it should return results.
    >Repeat it dozens of times. If this query is not always succesful then, and
    >only then, you can blame the network.
    >
    >>By the way this is only one of the problems that have occured when running
    >>the app on win2K. A bunch of other strange phenomenon like frozen processes,
    >>keyboard lockups and more are one the agenda for the moment...

    >
    >You keep on coming with surprises. Do your testing on a stable machine.
    >
    >hth
    >huibert



  9. #9
    Bernie Guest

    Re: Win2K and VB-apps using ADO, -Strange behavior


    Oh, I didn't mentioned it, but of course the code has been isolated and the
    query set to a fixed string during these extended tests....
    ...and 4 different machines running it for the moment!!

    "huibert" <hvandeursen@wanadoo.nl> wrote:
    >
    >"Bernie" <magnus.bernroth@rejlers.se> wrote:
    >>
    >>Hi,
    >>It makes a difference whether DB is locally or somewhere on the network

    >in
    >>such way that it fails very rarely when placed locally but more often when
    >>the LAN is involved.

    >
    >What I meant is that errors *DO* occur in both cases, local or network.
    >This means the network cannot be the cause of the error.
    >You don't indicate to us whether or not you have ran *exactly* the same

    query
    >in both cases, so the difference in frequency of the errors could
    >still be explained away by a non-systematic approach in your testing.
    >Look at your data and your query very carefully in the cases where
    >it fails. I'm sure you'll notice a pattern there.
    >
    >>The '#' in the like pattern means any numerical character on Access DB:s
    >>similar with '[0-9]' for SQL-server. First I was confused if this 'Access-style
    >>SQL' should work on ADO since '*' and '?' don't and must be replaced with
    >>'%' and '_' but we have been using it successfully for a long time now.

    >And
    >>the strange thing is why it works/not work randomly. If there is an error
    >>in the syntax it would be so all the time, would it not?

    >
    >There is no error in the syntax, since this would cause an error-message.
    >Successfully? You've got a case on your hands where the the LIKE operator
    >is still a suspect that has not been ruled out. The 'randomness' can still
    >be explained by unsystematic testing.
    >If you want to prove that network conditions are the cause of this problem
    >you have to repeat a query of which you know that it should return results.
    >Repeat it dozens of times. If this query is not always succesful then, and
    >only then, you can blame the network.
    >
    >>By the way this is only one of the problems that have occured when running
    >>the app on win2K. A bunch of other strange phenomenon like frozen processes,
    >>keyboard lockups and more are one the agenda for the moment...

    >
    >You keep on coming with surprises. Do your testing on a stable machine.
    >
    >hth
    >huibert



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center