grr.
I have two different select statements that are giving me the same error.. and its getting irritating cause i cant figure out why...
the error IS --tada--
-------------
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/vendorlist.asp, line 68
-------------
Here's the statement.. and ill point out line 68 below with a few other details...
-------------
Dim vendorRS, SQL
set vendorRS = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT ttVendors.company, ttVendors.website, ttVendors.phone, ttVendors.phone800,ttVendors.vendorID," &_
SQL = SQL & "ttInventory.newprice, ttInventory.refurbprice, ttInventory.oosprice, ttInventory.venddescrip" &_
SQL = SQL & "FROM ttVendors INNER JOIN ttInventory on ttVendors.vendorID = ttInventory.vendorID" &_
SQL = SQL & "WHERE ttInventory.prodID = '" &prodID& "'"
vendorRS.Open SQL ,objCn, 1, 3
DIM company
company = vendorRs("company")
vendorRs.close
set vendorRs = nothing
--------------
Ok so... line 68 IS
vendorRS.Open SQL ,objCn, 1, 3
ive tried it like
vendorRS.Open = SQL ,objCn, 1, 3
vendorRS.Open, SQL ,objCn, 1, 3
vendorRS.Open SQL ,objCn, 3, 3
no luck..
Also, prodID is passed from a querystring from previous page.. just used the typical request object to gather.. in the DB, all prodID fields are of INT type.. and im wondering if that makes a difference..
any ideas.. or blanks i can fill it?PS,, in Query analyzer, the statement works perfect...!!
Showing posts with label cause. Show all posts
Showing posts with label cause. Show all posts
Friday, March 9, 2012
Monday, February 27, 2012
HELP: problem with using xp_sendmail
below is code snippet (which im assuming is the cause of the problem) from a certain stored procedure
EXEC Master.dbo.xp_sendmail
@.dbuse = 'DanoneSSS',
@.recipients = 'xxx@.yyy.co.jp',
@.subject = 'mmm nnn',
@.message = @.parMessage,
@.query = 'SELECT CHECK_JS_CODE, CHECK_TYPE FROM T_CHECK_LOG WHERE CHECK_STATUS = 0 ORDER BY CHECK_ID',
@.attachments = 'ResultSet.txt',
@.attach_results = TRUE,
@.no_header = TRUE,
@.separator = '',
@.ansi_attachment = TRUE
as in my case, when i execute this particular stored procedure, SQL Server sends me the email AND with the necessary attachment
however, when i create a Job with "EXEC dbo.SOSOStoredProcedure," though the Job executes successfully, no EMAIL is sent to me.
the funny thing is, when i comment out the following lines
@.query = 'SELECT CHECK_JS_CODE, CHECK_TYPE FROM T_CHECK_LOG WHERE CHECK_STATUS = 0 ORDER BY CHECK_ID',
@.attachments = 'ResultSet.txt',
@.attach_results = TRUE,
@.no_header = TRUE,
@.separator = '',
@.ansi_attachment = TRUE
the Job executes successfully with an EMAIL being sent to me
does SQL Server's job CANNOT handle xp_sendmail that returns a RESULT set? or i may be mistaken somewhere...
thanks!Who is the owner of the job and what is the permission level ?|||Originally posted by rnealejr
Who is the owner of the job and what is the permission level ?
thanks for the reply...
but i did getting it working though...
by carefully reading through BO regarding xp_sendmail, it seems that in using xp_sendmail to send file attachments, the specific procedure must be defined in the master database. this is what i have done.
then, defined a permission level for the procedure's properties, and the specific entry in SQL Agent.
i may have gotten it working... but there still may be a gap in my understanding, and i would appreciate if anyone could check on this - Books Online could get so scarce in regards to explanations and examples.
again, thanks...|||the specific procedure must be defined in the master database
This is only done if the sa wants to conceal the behavior of xp_sendmail.
Which if that were the case you would have been unsuccessful regardless of where you ran the stored procedure.
then, defined a permission level for the procedure's properties, and the specific entry in SQL Agent.
Can you elaborate ?|||Alter the SP.
In the same sp, use exec master..xp_cmdshell 'isql "Your query" -o drive:\filename.txt etc'
Then remove the query portion from xp_sendmail.
Run the job again. It would work.|||I beleive (rightly or wrongly) that you are unable to run an open query within an xp_sendmail.
I am trying to run a stored procedure with an open query within it. wrapping it within an xp_sendmail.
Which fails.
Any sugestions on how to get this running.
Thanks
EXEC Master.dbo.xp_sendmail
@.dbuse = 'DanoneSSS',
@.recipients = 'xxx@.yyy.co.jp',
@.subject = 'mmm nnn',
@.message = @.parMessage,
@.query = 'SELECT CHECK_JS_CODE, CHECK_TYPE FROM T_CHECK_LOG WHERE CHECK_STATUS = 0 ORDER BY CHECK_ID',
@.attachments = 'ResultSet.txt',
@.attach_results = TRUE,
@.no_header = TRUE,
@.separator = '',
@.ansi_attachment = TRUE
as in my case, when i execute this particular stored procedure, SQL Server sends me the email AND with the necessary attachment
however, when i create a Job with "EXEC dbo.SOSOStoredProcedure," though the Job executes successfully, no EMAIL is sent to me.
the funny thing is, when i comment out the following lines
@.query = 'SELECT CHECK_JS_CODE, CHECK_TYPE FROM T_CHECK_LOG WHERE CHECK_STATUS = 0 ORDER BY CHECK_ID',
@.attachments = 'ResultSet.txt',
@.attach_results = TRUE,
@.no_header = TRUE,
@.separator = '',
@.ansi_attachment = TRUE
the Job executes successfully with an EMAIL being sent to me
does SQL Server's job CANNOT handle xp_sendmail that returns a RESULT set? or i may be mistaken somewhere...
thanks!Who is the owner of the job and what is the permission level ?|||Originally posted by rnealejr
Who is the owner of the job and what is the permission level ?
thanks for the reply...
but i did getting it working though...
by carefully reading through BO regarding xp_sendmail, it seems that in using xp_sendmail to send file attachments, the specific procedure must be defined in the master database. this is what i have done.
then, defined a permission level for the procedure's properties, and the specific entry in SQL Agent.
i may have gotten it working... but there still may be a gap in my understanding, and i would appreciate if anyone could check on this - Books Online could get so scarce in regards to explanations and examples.
again, thanks...|||the specific procedure must be defined in the master database
This is only done if the sa wants to conceal the behavior of xp_sendmail.
Which if that were the case you would have been unsuccessful regardless of where you ran the stored procedure.
then, defined a permission level for the procedure's properties, and the specific entry in SQL Agent.
Can you elaborate ?|||Alter the SP.
In the same sp, use exec master..xp_cmdshell 'isql "Your query" -o drive:\filename.txt etc'
Then remove the query portion from xp_sendmail.
Run the job again. It would work.|||I beleive (rightly or wrongly) that you are unable to run an open query within an xp_sendmail.
I am trying to run a stored procedure with an open query within it. wrapping it within an xp_sendmail.
Which fails.
Any sugestions on how to get this running.
Thanks
Subscribe to:
Posts (Atom)