Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exe crashes when the program returns to

Status
Not open for further replies.

princessk1

Programmer
Feb 28, 2002
74
0
0
CA
I am calling a stored procedure from vb that fills a table with a small amount of information and then using the data in the table to create a text file. The beginning of the code looks like this:

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\Export\imapdtl.tab", True)

cmd.ActiveConnection = conn

'call stored procedure that calculates sales total
cmd.CommandText = "usp_tempConsignmentSales"
cmd.CommandTimeout = 1000
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("startdate", adVarChar, adParamInput, 10)
cmd.Parameters("startdate").Value = DTStartDate
cmd.Parameters.Append cmd.CreateParameter("enddate", adVarChar, adParamInput, 10)
cmd.Parameters("enddate").Value = DTEndDate
cmd.Execute
cmd.Parameters.Refresh

I get an illegal error when using the executable.
Does anyone have any ideas as to why this would happen?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top