you are going to have a problem here
Code:
if (Recordset1.Fields.Item("id_user"))>"90000000" then
try
Code:
if (Clng(Recordset1.Fields.Item("id_user")))>90000000 then
I assume these lines
Code:
nama=str("pelNamaPelajar")
nama=str("namastaffuitm")
are meant to be using the value you got from your second query.... but you haven't done the second query yet, just written the sql statement...
try
Code:
if (Recordset1.Fields.Item("id_user"))>"90000000" then
str="SELECT pelNamaPelajar From tbstudent where tbstudent.pelNoPelajar= '" & Recordset1.Fields.Item("id_user")& "' "
else
str="SELECT namastaffuitm From staffIT where staffIT.nostaffuitm='" & Recordset1.Fields.Item("id_user")& "' "
end if
Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_sambungan_STRING
Recordset2.Source = str
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()
if not recordset2.eof then
nama = recordset2(0).value
else
nama = "no matching record"
end if