[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
Re: Very Weird query problem
Without seeing the query it is impossible to say, and extremely difficult to speculate.
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.)
Re: Very Weird query problem
Is the server somewhere else? could be latency issues.
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.
:confused: Really :confused:
Re: Very Weird query problem
I was solved the problem .
I didnt close connection after before recordset query.
Thanks everyone :-)