troubleshooting Question

Urgent - Error -2147217900 - not able to save to the database - Please help

Avatar of amruthanet
amruthanet asked on
Microsoft SQL Server
5 Comments1 Solution277 ViewsLast Modified:
The program and store procedure works fine, when hsaplan has values.  

Whenever the session variable does not exist or empty, it is throwing this error.  Please help.

This is the error we received:
spConfirmEmp "W0000012206"," "," "," "," YNNBNNNN"," "," ",34,0,,' 'Error -2147217900. Line 1: Incorrect syntax near ','.
Information was not saved.
___________________________________________________________________________________________________
ASP code:

<%
err.number=0
on error resume next
'Update database with session variables
Dim strCmd
Dim intErrorNum
Dim strErrorDesc
Dim hcamt
Dim dcamt
Dim strMPCP

conn.BeginTrans

'Employee and FSA update
'Create command string
hcamt = Session("fsahcamount")
dcamt = Session("fsadcamount")
hsaAmount = Session("Hsa_Amount")
hsaPlan = session("HSA_Plan")' HSA single or dependent
If not isnumeric(hcamt) AND not isnull(hcamt) then hcamt = 0
If not isnumeric(dcamt) AND not isnull(dcamt) then dcamt = 0
If not isnumeric(hsaAmount) AND not isnull(hsaAmount) then hsaAmount = 0


strMPCP = Session("medicalpcp")

if session("MemberNewPlan") = "      "      then
hsaPlan = "      "
end if

if session("MemberNewPlan") = "      " then
hsaAmount =0
end if


If strMPCP = "" Then strMPCP = " "

strCmd = "spConfirmEmp " & QT & Session("emplid") & QT & "," & QT & _
            Session("medicalplan") & QT & "," & QT & Session("dentalplan") & _
            QT & "," & QT & Session("visionplan") & QT & "," & QT & Session("empflags") & _
            QT & "," & QT & strMPCP & QT
strCmd = strCmd & "," & QT & " " & QT & "," & hcamt & "," &  dcamt & _
            "," & hsaAmount & ",'" & hsaPlan & "'"


Response.Write strcmd
'Response.End


conn.execute(strcmd)


If Err.number <> 0 then
      conn.RollbackTrans
      Response.Write("Error " & Err.number & ". " & Err.Description)
      Response.Write("<BR>Information was not saved.<BR>")
      Response.End
End If

_____________________________________________________________________________________________
ASKER CERTIFIED SOLUTION
Hypnochu

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros