Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts

    Object doesn't support this property or method: 'EOF' /Default.asp, line 11

    Hello,

    This is just a very simple log-in form.

    I can access the fields of the record set but when I reference EOF or RecordCount I get the fore mentioned error. Can anyone tell me how I can fix this or what I am doing wrong?

    Here is the code I wrote:

    Code:
    <!--#include virtual="db.inc"-->
    <html>
    <head>
    <link href="login.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="main.js"></script>
    </head>
    <%
    un=request("UserName")
    pw=request("pwrd")
    	Set rsObj=GetSQL("SELECT * FROM prUsers WHERE prUserName='" & un & "' AND prAuthen='" & pw & "'")
    	
    	if rsObj.EOF then
    	    response.Write("Invalid user name or password!")
    	else
    	    response.Write(rsObj("UserName"))
    	end if
    %>
    <div id="logMe">
    <form method="post" action="default.asp">
    <input type="hidden" value="" name="tmp">
    <table>
    	<thead>
    		<th colspan="2">Log-In</th>
    	</thead>
    	<tr>
    		<td>User Name:</td>
    		<td><input type="text" name="username" id="username" /></td>
    	</tr>
    	<tr>
    		<td>Password</td>
    		<td><input type="password" name="pwrd" id="pwrd" /></td>
    	</tr>
    	<tr>
    		<td colspan="2" class="btm"><input onclick="document.forms[0].tmp.value='go';" type="submit" value="Log-In" />
    		 <input type="button" onclick="window.location.href='login.asp'" value="New Member" /></td>
    	</tr>
    	</table>
    	</tr>
    	</thead>
    </table>
    </form>
    </div>
    </body>
    </html>
    here is the code from the include file my buddy wrote to access the DB:

    Code:
    Response.ExpiresAbsolute = DateAdd("yyyy", -10, Now)
    
    Dim sConnString
    sConnString = "DRIVER={SQL Server};SERVER=******;UID=sa;PWD=*****;DATABASE=DB1"
    
    Function GetSQL(SQL)
    	On Error Resume Next
    	Set oConn = Server.CreateObject("ADODB.Connection")
    	oConn.Open sConnString
    	
    	Set rsObj = Server.CreateObject("ADODB.Recordset")
    	rsObj.CursorLocation = 3
    		
    	rsObj.Open SQL, oConn, 1, 3, 1
    	Set rsObj.ActiveConnection = Nothing
    	GetSQL = rsObj	
    	
    	oConn.Close
    	Set oConn = Nothing
    	
    	If Err <> 0 Then
    		Response.Write "<BR>" & Err.Description
    		Response.End
    	End If
    End Function
    Thanks,
    Basscyst
    Last edited by Basscyst; 07-01-2004 at 02:39 AM.
    Helping to build a bigger box. - Adam Matthews

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,960
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Change this line:

    GetSQL = rsObj

    to

    Set GetSQL = rsObj


    Use the Set keyword if you're creating objects.

  • #3
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Once again Glenngv, Thank You!!! I can't get the smile off my face.

    Basscyst
    Helping to build a bigger box. - Adam Matthews


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •