Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

VB6 Database connection

  • 01-06-2007 9:01am
    #1
    Registered Users, Registered Users 2 Posts: 213 ✭✭


    Whats the best/fastest way to connect to a database using VB6?

    I'm currently using the connection string
    Provider=MSDASQL.1;Persist Security Info=False;Data Source=DSN

    which works fine. But at times, it can be slowing retrieving info from the database. Is there another connection method I could use that would be faster or can anyone suggest a way to spead up retrieval from the database?


    Also, as a side question, how is data retrived via ODBC? is it brought back in one lump or streamed back, etc.

    Cheers


Comments

  • Registered Users, Registered Users 2 Posts: 9,560 ✭✭✭DublinWriter


    underpants wrote:
    Also, as a side question, how is data retrived via ODBC? is it brought back in one lump or streamed back, etc.
    It really all depends on how the underlying ODBC driver and DBMS was designed. Most ODBC drivers will have proprietry settings that you can change for things like fetch-sizes, etc.

    With DBMSes like Oracle and Sybase, it's usually best-pracise to try and get a native driver that will allow you bypass the ODBC API.

    What DBMS are you using?


  • Registered Users, Registered Users 2 Posts: 213 ✭✭underpants


    What DBMS are you using?

    It's an MS SQL Server


  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    Your connection string is (most) irrelevant. How you run your queries is generally where the major differences are.

    have a read of this : http://www.microsoft.com/technet/prodtechnol/sscomm/reskit/mdacapp.mspx

    Might help.


  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    you could try and run your sql in the database and see if it is slow there and if so then its not the driver but more your SQL/Database design


  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    underpants wrote:
    Also, as a side question, how is data retrived via ODBC? is it brought back in one lump or streamed back, etc.

    If you can avoid it, don't via ODBC in the first place. use the native OLE DB Provider instead.

    Either which way, the answer will be "it depends"

    Have a look at this article for some good notes on teh subject : http://www.sql-server-performance.com/visual_basic_performance.asp


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 9,560 ✭✭✭DublinWriter


    bonkey wrote:
    If you can avoid it, don't via ODBC in the first place. use the native OLE DB Provider instead.
    Usually the best option for MS SQL Server.

    You should also look at your use of indices and how complex your joins are.


  • Registered Users, Registered Users 2 Posts: 213 ✭✭underpants


    Good stuff.

    thanks guys.


Advertisement