Results 1 to 6 of 6

Thread: [RESOLVED] Very Weird query problem

  1. #1

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Resolved [RESOLVED] Very Weird query problem

    Hi all,
    I had done many query by using adodb and Sqlserver database.
    But i had met a weird problem, I do a simple select query (Select Field From Table Where SomeField = 'blabla'. I make query via sqlserver query that was taken a very little time to obtain the record. However, in my coding when i'm checking eof of the record it was stuck about 10 seconds there.I wonderred what is the problem. I ever do many same thing before but there are no such problem.


    Is anyone ever met this problem, please help me to solve it

    Thanks
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Very Weird query problem

    Without seeing the query it is impossible to say, and extremely difficult to speculate.

  3. #3
    Frenzied Member Campion's Avatar
    Join Date
    Jul 2007
    Location
    UT
    Posts
    1,098

    Re: Very Weird query problem

    Since the query is taking very little, or no time, but the EOF is sticking, this could possibly point to the database connector (ODBC, or any specialized connectors.)

  4. #4
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Very Weird query problem

    Is the server somewhere else? could be latency issues.

  5. #5

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: Very Weird query problem

    Thanks Hack,zynder,Champion to answer my question i post my coding as below.

    VB Code:
    1. Dim rs As ADODB.Recordset
    2. Dim pstrWHERE As String
    3.  
    4.  pstrWHERE = " WHERE RefNo = '" & Me.lvwPMList.ListItems.Item(Deleteindex).Text & "'"
    5.  Set rs = SQLSELECT("Status", "Preventive_Main", pstrWHERE , "", "", "Maintenance")
    6.       If Not (rs.BOF Or rs.EOF) Then          
    7.  If rs.Fields(0) <> "Confirm" Then
    8.                 MsgBox "Cannot solve the problem if the status of item schedule is not confirmed", vbCritical, "Unabled to update record"
    9.                 Exit Sub
    10.             End If
    11.         End If

    I used the same method of coding inside the same project. All are fine.
    Only this highlighted statement.
    If Not (rs.BOF Or rs.EOF) Then. Entire project is using same server and also using same connector.

    Really
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  6. #6

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: Very Weird query problem

    I was solved the problem .
    I didnt close connection after before recordset query.

    Thanks everyone :-)
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

Posting Permissions

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



Click Here to Expand Forum to Full Width