Thread: ADO problems

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    2
    Rep Power
    0

    Question ADO problems


    Hi
    I hope someone can help me!
    I have a client server application on which the server accesses the database using ADO!
    However, there is a problem!
    The server doesnīt seem to send all information to the database - sometimes the data is lost! There seems to be some concurrency problem!
    Has anyone had this problem before?
    I have code if anyone wants to see

    Thanks in advance
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    Please post the relevant code including what you expect to see and what is being returned instead.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    2
    Rep Power
    0
    Simply I have created 2 component queries
    ADOQuery1 := TADOQuery.Create(self);
    ADOQuery1.Connection := conexionBD;

    ADOQuery2 := TADOQuery.Create(self);
    ADOQuery2.Connection := conexionBD;
    which I use to send to the server.
    However, I have lots of clients who connect to the server via http. So these clients could send data at the same time. However, the adoqueries donīt seem to be able to handle this. I am thinking about creating an array of queries, so that a client can use a free one. But this is not the way it should work. There should be ONE adoQuery on the server for many clients and this ADOQuery should be able to handle concurrency. I have been looking on ADO help but canīt really find anything. Do you know of any ADO properties that allow this to happen?
    Thanks
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    Let me get this straight... you have two query objects and when a client connects, you use the query objects to retrieve data from the database. Here's the big problem then:

    When you run a query, if the result set is large, the query is not returned to the client all at once. One way to retrieve all of it back is to use the Last method to move to the last record in the result set. However, if you're in a multiuser environment, this is not a good idea, esp. if there's a chance that another client can connect before you retrieve all your results.

    Best way to handle this would be to create a query object dynamically, when a client connects and destroy it after the client disconnects.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo