|
-
Mar 17th, 2005, 10:19 AM
#1
Re: no results found
 Originally Posted by pame1la
but it doesnt let me open the rs, comes up with that error!!! i can only check the state if its open rite?!
Guessing that you got an error on the SQL side then - so no RS at all...
So check
Code:
If rs is Nothing Then
MsgBox "Got no RS"
End if
-
Mar 17th, 2005, 10:30 AM
#2
Thread Starter
Hyperactive Member
Re: no results found
Private Sub Serach_Click()
If txtName.Text = "" Then
MsgBox "Please enter product name", vbOKOnly, "Search Error"
Else
Str = "SELECT * From Details WHERE ItemName = '" & txtName.Text & "'"""
rs.Open strTemp, gcnSV, adOpenForwardOnly, adLockReadOnly
If rs.State = 0 Then
MsgBox "No records match", vbOKOnly, "Search Result"
or
Private Sub Serach_Click()
If txtName.Text = "" Then
MsgBox "Please enter product name", vbOKOnly, "Search Error"
Else
Str = "SELECT * From Details WHERE ItemName = '" & txtName.Text & "'"""
If Str = "" Then
MsgBox "No records match", vbOKOnly, "Search Result"
WHAT AM I DOIN WRONG?
-
Mar 17th, 2005, 10:56 AM
#3
Re: no results found
 Originally Posted by pame1la
Private Sub Serach_Click()
If txtName.Text = "" Then
MsgBox "Please enter product name", vbOKOnly, "Search Error"
Else
Str = "SELECT * From Details WHERE ItemName = '" & txtName.Text & "'"""
rs.Open strTemp, gcnSV, adOpenForwardOnly, adLockReadOnly
If rs.State = 0 Then
MsgBox "No records match", vbOKOnly, "Search Result"
or
Private Sub Serach_Click()
If txtName.Text = "" Then
MsgBox "Please enter product name", vbOKOnly, "Search Error"
Else
Str = "SELECT * From Details WHERE ItemName = '" & txtName.Text & "'"""
If Str = "" Then
MsgBox "No records match", vbOKOnly, "Search Result"
WHAT AM I DOIN WRONG?
What is this mess at the end of the string??
Str = "SELECT * From Details WHERE ItemName = '" & txtName.Text & "'"""
It should simply be:
Code:
Str = "SELECT * From Details WHERE ItemName = '" & txtName.Text & "'"
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
|