Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select problem ....

Status
Not open for further replies.

miglou

Programmer
May 28, 2002
37
0
0
PT
Hello,
i made a small application in access2000, and in my computer it works fine, but, if i run same application when making a select i have no results.
Public Function getOpGrava(d, o)
Dim conDatabase As ADODB.Connection
Dim rstGrav As ADODB.Recordset
Dim strSQL As String
Dim OpGrava
OpGrava = 0
Set conDatabase = CurrentProject.Connection

strSQL = "SELECT grav FROM prod WHERE day=#" & d & "# AND op='" & o & "'"
Set rstGrav = New Recordset
rstGrav.Open strSQL, conDatabase, adOpenDynamic, adLockOptimistic
Dim eer
With rstGrav
If Not .EOF And Not .BOF Then
eer = .GetString(adClipString)
eer = Replace(eer, vbCr, "")
If eer <> &quot;&quot; Then
OpGrava = eer
End If
End If
End With
rstGrav.Close
conDatabase.Close
Set rstGrav = Nothing
Set conDatabase = Nothing
' setOpGrava = 1

getOpGrava = OpGrava
''Execute * exemplo VB
End Function

in this condition:&quot;If Not .EOF And Not .BOF Then&quot; it jump to End if.... but in my computer dont .....
anyone have any idea ....
T.Y.

 
I don't know the source of the problems - but here's some advise on how to search it out.

After
Code:
Dim err
put
Code:
MsgBox strSQL

so that you can have a good look at the SQL string and check that they match on both machines.

Then put a break point on the
Code:
If .EOF .. ..
line

Then, once the code is in break mode, hover your mouse over .EOF and a tip box will appear and tell you if EOF is True or False.

Check .BOF as well

You can then compare the two machines and find out WHAT exactly is different.


That should then help you along the way to sorting it out.



'ope-that-'elps.



G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
as aspected...
my computer: EOF and BOF - False
other one: EOF and BOF - True
...... why ??????
T.Y.
 
eof and bof means there are records in one set and not in the other.


rollie@bwsys.net
 
.....
i solved my problem with other selects, because the main problem was when searching date... i got problems....i dont know why....
T.Y. all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top