Results 1 to 11 of 11

Thread: Database Connection Error

  1. #1
    Join Date
    Jun 2005
    Posts
    9

    Database Connection Error

    We have a VB 6.0 application that displays a timeout error whenever large SQL tables are queried (over 30K records). Is there a solution to this besides extending the timeout value for the connection? We need to upgrade the app to VB.Net, but need to sort through spaghetti. Is there anything that can be done now to enhance the ADO objects used or re-enginer the code?

  2. #2
    Join Date
    Jun 2005
    Posts
    9
    Here is the Error:

    ADO Command Timeout
    Runtime error -214721781 (80040e31)

    [Microsoft][ODBC SQL Server Driver]Timeout expired

  3. #3
    Join Date
    Feb 2003
    Posts
    1,048
    30K records is a small table in database terms. Sounds like you need indexes and likely query optimizations.

  4. #4
    Join Date
    Jun 2005
    Posts
    9
    We have indexes on most of the tables hitting the server. It appears that the connections are not pooled and as a result each user is knocked out.

  5. #5
    Join Date
    Feb 2003
    Posts
    1,048
    Are you using individual logins based on the user or a central application based login?

  6. #6
    Join Date
    Jun 2005
    Posts
    9
    Central application login.

  7. #7
    Join Date
    Sep 2002
    Posts
    5,938
    Do you enable connection pooling in odbc?

  8. #8
    Join Date
    Jun 2005
    Posts
    9
    Is this done through the VB application or on SQL Server.

  9. #9
    Join Date
    Sep 2002
    Posts
    5,938
    In application.

  10. #10
    Join Date
    Nov 2008
    Posts
    2

    ado.net connection

    connetionString = "Data Source=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password"
    cnn = New SqlConnection(connetionString)
    Try
    cnn.Open()
    MsgBox("Connection Open ! ")
    cnn.Close()
    Catch ex As Exception
    MsgBox("Can not open connection ! ")
    End Try

    yang.

  11. #11
    Join Date
    Nov 2008
    Posts
    2
    if you want to know more about ado.net , follow th url

    http://vb.net-informations.com/ado.n...connection.htm

    yang.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •