Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Location
    Jhb
    Posts
    20

    Unanswered: Timeout Error in VB6/SQL2000

    I've created a stored procedure in SQL 2000. I run an execute statement through VB6 and then after a short while, I have a timeout expired message box appearing. My connection string is as follows :-

    Option Explicit
    Public PortCis As New ADODB.Connection

    Private Sub Form_Load()
    Dim SQL As String

    Set Form1.PortCis = Nothing
    PortCis.Open "Provider=SQLOLEDB.1;Server=hqcsql02\hqcsql02; " & "Database=Statements;Trusted_Connection=Yes;Connec tion Timeout=30"

    SQL = " exec PortCis.dbo.portcis_getbdastatement_statementsdb '200312'"
    PortCis.Execute SQL
    End

    End Sub

    When the timeout error occurs, I check in the table that it is populating and find that it has added 365 records out of a possible 100,000.

    What am I doing wrong ?

    Thanks

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Change from Connection Timeout=30 to Connection Timeout=0. That should solve the problem
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    Aug 2003
    Location
    Jhb
    Posts
    20
    Hi Enigma...no go... Same error after the same amount of records - 365.

    Thanks..

  4. #4
    Join Date
    Aug 2004
    Posts
    1

    Talking Had the same problem ... now solved

    Lo there

    Had the same VB6 / SQL Server timeout issues, got round with this :

    note :
    ojbcommand => ADODB.Command
    objConnection => ADODB.Connection

    objCommand.ActiveConnection = objConnection
    objCommand.CommandText = strSQL
    objCommand.CommandTimeout = 600
    objCommand.Execute

    As objconnection.Connectiontimeout and objconnection.commandtimeout seemed not to be working for me too ...

Posting Permissions

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