Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Sql Server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-28 : 09:08:07
Sanjay writes "I am getting Error "Exception Occured "

i have to Add/update two tables.
Ex: Emp & EmpPrj

in Emp Table EmployeeId is Auto.
so when i add new record in Emp i have to add Related Record in EmpPrj.
Please go thru code
Set Rs=server.createobject("Adodb.recordset")
rs.open "SELECT * FROM EMP WHERE employeeId=" & EmpId & ",Con,3,3

if rs.bof and rs.eof then
rs.addnew
end if

rs("EmployeeName")=Ename
rs("Address")=Address

rs.update

now i want the Employee ID Generated for this Emplyoee so that i can Add in Other table so..

rs.movenext
rs.moveprevious
if EmpId ="" then
EmpID=rs("employeeId") *******AT THIS PLACE I AM GETTING ERROR
*****"EXCEPTION OCCURED"
End if

How to Proceed? please help me"
   

- Advertisement -