Need some help. I am using some code that tells me the identity of a record added.
The problem is that when no record is added it returns nothing and when I try
to response it out using the following it does not work.
if iCurrentValue = " " then
response.write "please contact webmaster at hharda9791@aol.com"
end if
My question is why. I know it is space because I see nothing when I do this
response.write " the response is " & iCurrentValue & " was there something"
I just do not understand why I can not check it using and if.
I even did
if isempty iCurrentValue then
response.write ""
end
and this did not work either.
I included more code below
Thanks
Howard
sSQL = "insert into request (fname,lname,company_name,business_type,location_numbers,employee_numbers,interests,phone,address,zip,email) values ("
sSQL = sSQL & "'" & strFname & "',"
sSQL = sSQL & "'" & strLname & "',"
sSQL = sSQL & "'" & strCompany & "',"
sSQL = sSQL & "'" & strBizType & "',"
sSQL = sSQL & "'" & strLocation & "',"
sSQL = sSQL & "'" & strEmp & "',"
sSQL = sSQL & "'" & strInterest & "',"
sSQL = sSQL & "'" & strPhone & "',"
sSQL = sSQL & "'" & strAddress & "',"
sSQL = sSQL & "'" & strZip & "',"
sSQL = sSQL & "'" & strEmail & "')"
'Set oRs = oConn.Execute(sSQL)
'oConn.Execute(sSQL)
'Set oRs = nothing
'Now, we must get the identity for the value we just inserted!
Dim rsIdentity 'a recordset to hold the identity value
'This line of code will get us the indentity value for the row
' we just inserted!!
Set rsIdentity = oConn.Execute("SELECT SCOPE_IDENTITY() FROM request")
'Read the current value:
Dim iCurrentValue
iCurrentValue = rsIdentity(0)
if iCurrentValue = " " then
response.write "please contact webmaster at hharda9791@aol.com"
end if
'response.write strFname & "<br>"
'response.write strLname & "<br>"
'response.write strCompany & "<br>"
'response.write strBizType & "<br>"
'response.write strLocation & "<br>"
'response.write strEmp & "<br>"
'response.write strInterest & "<br>"
'response.write strPhone & "<br>"
'response.write strAddress & "<br>"
'response.write strZip & "<br>"
'response.write strEmail & "<br>"
response.write " the response is " & iCurrentValue & " was there something"
'response.write sSQL
rsIdentity.Close
The problem is that when no record is added it returns nothing and when I try
to response it out using the following it does not work.
if iCurrentValue = " " then
response.write "please contact webmaster at hharda9791@aol.com"
end if
My question is why. I know it is space because I see nothing when I do this
response.write " the response is " & iCurrentValue & " was there something"
I just do not understand why I can not check it using and if.
I even did
if isempty iCurrentValue then
response.write ""
end
and this did not work either.
I included more code below
Thanks
Howard
sSQL = "insert into request (fname,lname,company_name,business_type,location_numbers,employee_numbers,interests,phone,address,zip,email) values ("
sSQL = sSQL & "'" & strFname & "',"
sSQL = sSQL & "'" & strLname & "',"
sSQL = sSQL & "'" & strCompany & "',"
sSQL = sSQL & "'" & strBizType & "',"
sSQL = sSQL & "'" & strLocation & "',"
sSQL = sSQL & "'" & strEmp & "',"
sSQL = sSQL & "'" & strInterest & "',"
sSQL = sSQL & "'" & strPhone & "',"
sSQL = sSQL & "'" & strAddress & "',"
sSQL = sSQL & "'" & strZip & "',"
sSQL = sSQL & "'" & strEmail & "')"
'Set oRs = oConn.Execute(sSQL)
'oConn.Execute(sSQL)
'Set oRs = nothing
'Now, we must get the identity for the value we just inserted!
Dim rsIdentity 'a recordset to hold the identity value
'This line of code will get us the indentity value for the row
' we just inserted!!
Set rsIdentity = oConn.Execute("SELECT SCOPE_IDENTITY() FROM request")
'Read the current value:
Dim iCurrentValue
iCurrentValue = rsIdentity(0)
if iCurrentValue = " " then
response.write "please contact webmaster at hharda9791@aol.com"
end if
'response.write strFname & "<br>"
'response.write strLname & "<br>"
'response.write strCompany & "<br>"
'response.write strBizType & "<br>"
'response.write strLocation & "<br>"
'response.write strEmp & "<br>"
'response.write strInterest & "<br>"
'response.write strPhone & "<br>"
'response.write strAddress & "<br>"
'response.write strZip & "<br>"
'response.write strEmail & "<br>"
response.write " the response is " & iCurrentValue & " was there something"
'response.write sSQL
rsIdentity.Close