|
|
|
|
|
| | |
|
Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: Access 97 and ASP |
From: |
Harlan |
Date: |
2/2/1999 9:16:30 AM |
IP: |
206.222.20.2 |
Here is what I usually do. I put my recordset
evaluations in a function
dim DB
dim errNoneFound, errUnknown
errNoneFound = "No records found matching your search."
errUnknown = "An unknown error occured, please
contact the system administrator."
private function rsFunction(sSQL)
I wont write DBOpen() here, but its
just a sub that opens the database.
DBOpen(gsDSN,gsUID,gsPWD)
Set rsRecordset = DB.Execute(sSQL)
eof and bof return true when you are at
the "end of file" and the "beginning of file"
at the same time.. meaning no records returned.
If rsRecordset.EOF And rsRecordset.BOF Then
rsFunction = errNoneFound
Exit Function
in order to use .count make sure you use a
non-forward only curser
count is equal to -1 when the recordset itself
didnt return, meaning you have an error.
If rsRecordset.count = -1 Then
rsFunction = errUnknown
Else
Do While Not rsRecordset.EOF
strTemp = strTemp & rsRecordset("SomeColumn")
rsRecordset.MoveNext
Loop
rsFunction = strTemp
End If
hope that made things clearer..
|
Previous Message
|
|

|
|
|
|
|
|
|
|
|
|