|
-
Nov 20th, 2002, 09:15 AM
#1
Thread Starter
Lively Member
Error using recordset object
Hello
I am using Visual Interdev with IIS 5.0.I have a dataentry form where in
when i click the button it has to go to the next record.
My code is:
<BODY>
<%
public cn, rst, strSQL
Set cn = Server.CreateObject("ADODB.Connection")
cn.ConnectionTimeout =30
cn.open "FILEDSN=emp.dsn"
Set rst = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM employee"
rst.Open strSQL,cn
set txtemp_id.value = rst("emp_id")
set txtemp_fname.value = rst("fname")
set txtemp_lname.value = rst("lname")
%>
</BODY>
The coding in the button is
Sub btn_movenext_onclick()
rst.Open '---> Line 14
rst.MoveNext
End Sub
It is giving me the error :
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'rst'
emp_file.asp, line 14
Please let me know where i could have done the mistake.
Thanks
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
|