Community discussion forum

OLEDB Connection running like a dog.

  • 3 years ago

    Hi there,

    I have an OLE DB Connection to an access MDB file on a seperate server. I have created a connection to it in the Visual Studio IDE using the nice easy wizards.

    I have created OLEDataAdapters using this connection and created Datasets from these Adapters. All of this works like clockwork.

    Now.

    If I build my solution and run up the website (Ctrl-F5) then it runs like greased lightening and is very pleasing.

    If, however, I close the Visual Studio and browse to the website it takes an age, like 10 times as long, to load up.

    Now, this is wierd.

    If I load the IDE back up and Ctrl-F5 the project it runs like a dog here too. Very odd.

    If I then right click and 'Configure' one of my DataAdapters but don't change anything, just click through and OK at the end of the wizard, then Ctrl-F5, what do you know, the site is nice and fast again.

    Why wont the connection stay nice and fast outside of the IDE??

    Please help. This is meant to be used by hundreds of people in the company in 4 weeks and it is just not fast enough as it is...

    Thanks

    Tom

  • 3 years ago

    This is the connection string.... seems a little over complex to me.

    Me.TomConn.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Database Password=;Data Source=""\\MyServer\DBDir\database.mdb"";Password=;Jet OLEDB:Engine Type=4;Jet OLEDB:Global Bulk Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False"

  • 3 years ago

    I've noticed the same thing on my developement computer running IIS. I believe it has alot to do with the page being requested for the first time from IIS (not using VS IDE) and asp.net has to compile the .Net page into IL before can be served.

    Try building the site in VS then requesting it with your browser - the first time should be slow after that it should run fast.

    For performance gain if your using VS 2005 (.Net2.0) in VS "Publish" the site this creates a "release" pre-compiled version of the site - then request that. Or in VS 2003 build a release version (debug version is meant to be slower).

    Besides that VS generated ADO.NET code is robust but not the best performing.

    Regards

    Brin

  • 3 years ago

    Aint that the truth,

    Visual Studio 2003 by the way.

    Thanks for the reply. I changed the build configuration to be 'release' instead of 'debug' and re-built the solution but this had no effect...

    For my 2 pennies, I recon Visual Studio makes (and keeps) the connection when you configue a data adapter then when you run it it is really fast. Of course, as soon as VS is closed you need to make the connection again...

    The only reason I don't really believe that is that surely once the connection is established in IE the next time you load the page should be nice and quick, but it's not...

    Any ideas?

    Thanks

    Tom.

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback