|
-
Nov 9th, 2007, 05:45 AM
#1
Thread Starter
Hyperactive Member
[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.
-
Nov 9th, 2007, 06:54 AM
#2
Re: Very Weird query problem
Without seeing the query it is impossible to say, and extremely difficult to speculate.
-
Nov 9th, 2007, 07:36 AM
#3
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.)
-
Nov 9th, 2007, 07:38 AM
#4
Re: Very Weird query problem
Is the server somewhere else? could be latency issues.
-
Nov 9th, 2007, 07:56 PM
#5
Thread Starter
Hyperactive Member
Re: Very Weird query problem
Thanks Hack,zynder,Champion to answer my question i post my coding as below.
VB Code:
Dim rs As ADODB.Recordset
Dim pstrWHERE As String
pstrWHERE = " WHERE RefNo = '" & Me.lvwPMList.ListItems.Item(Deleteindex).Text & "'"
Set rs = SQLSELECT("Status", "Preventive_Main", pstrWHERE , "", "", "Maintenance")
If Not (rs.BOF Or rs.EOF) Then
If rs.Fields(0) <> "Confirm" Then
MsgBox "Cannot solve the problem if the status of item schedule is not confirmed", vbCritical, "Unabled to update record"
Exit Sub
End If
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.
-
Nov 9th, 2007, 09:53 PM
#6
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|