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)
 objCmd execute error

Author  Topic 

krc77
Starting Member

1 Post

Posted - 2004-10-27 : 08:37:56
strSQL = "INSERT INTO new_hires_disposition (county_no,client_id,er_fed_tax_id,w4_sign_dt," & _
"load_no,case_number,fia_load_date,disposition_code,disposition_date," & _
"comment_seq_no,request_4635_date,print_4635_ind,fs_ind,assist_prog_code) " & _
" VALUES (?,?,?,?,?,?,?,?,null,?,null,?,?,?)"

objCmd.CommandText = strSQL
objCmd.CommandType = adCmdText
objCmd.Parameters.Append objCmd.CreateParameter("county_no", 5, 1, 0, strASTCountyNo)
objCmd.Parameters.Append objCmd.CreateParameter("client_id", 5, 1, 0, strClientid)
objCmd.Parameters.Append objCmd.CreateParameter("er_fed_tax_id", 5, 1, 0, strErfedtaxid)
objCmd.Parameters.Append objCmd.CreateParameter("w4_sign_dt", 133, 1, 0, strW4Signdt)
objCmd.Parameters.Append objCmd.CreateParameter("load_no", 5, 1, 0, (strASTloadno10))
objCmd.Parameters.Append objCmd.CreateParameter("case_number", 200, 1, 9, (strCasenumber))
objCmd.Parameters.Append objCmd.CreateParameter("fia_load_date", 133, 1, 0, (strFialoaddt))
objCmd.Parameters.Append objCmd.CreateParameter("disposition_code", 200, 1, 1, BlankStr(strDispositioncode))
objCmd.Parameters.Append objCmd.CreateParameter("comment_seq_no", 5, 1, 0, BlankNum(strCommentseqno))
objCmd.Parameters.Append objCmd.CreateParameter("print_4635_ind", 200, 1, 1, BlankStr(strPrint4635ind))
objCmd.Parameters.Append objCmd.CreateParameter("fs_ind", 200, 1, 1, (strFsind))
objCmd.Parameters.Append objCmd.CreateParameter("prog_code", 200, 1, 4, (strAssistPgmcd))
310 objCmd.Execute , , 129

When the last line is reached it errors out and never executes the insert.
Thanks for any help.

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2004-10-29 : 16:40:52
What is the "310" on the last line? Is that just an error in your post? What does the error message say?

Rather than have the two fields as null in your VALUES clause, try creating two parameters and setting the parameters to null to make sure everything lines up properly.

-----------------------------------------------------
Words of Wisdom from AjarnMark, owner of Infoneering
Go to Top of Page

Knarf180
Starting Member

42 Posts

Posted - 2004-10-29 : 16:44:56
310 looks like a typo to me aswell. Also, have you told the command what its active connection is?
Go to Top of Page
   

- Advertisement -