Pages

Thursday, April 25, 2013

Min (n) must be less than or equal to max (-1) in a Range object.

This happened to me when I would read an XML file into a Dataset, as follows:

string sort = "";
string where = string.Format("userID={0}", EmployeeID);
DataSet ds = new DataSet();
ds.ReadXml(XMLFilename);
DataRow[] rows = ds.Tables[0].Select(where, sort, DataViewRowState.CurrentRows);

The userID column is numeric, yet I found that I could make this error dissappear by single-quoting the parameter like this.

string where = string.Format("userID='{0}'", EmployeeID);

...

Bryan Valencia is a contributing editor and founder of Visual Studio Journey.  He owns and operates Software Services, a web design and hosting company in Manteca, California.

Saturday, April 13, 2013

The "SendUsing" configuration value is invalid.

I am moving a asp classic app from Windows SBS 2003 IIS 7 to Windows Server 2012 IIS 8.
After spending all day figuring out a dozen different things, the site finds itself unable to send emails.  So I constructed a simple email sender to test it out.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> Email Test </title>
 </head>

 <body>
<%
    Set myMail=CreateObject("CDO.Message")
    myMail.Subject="Sending email with CDO"
    myMail.From="doNotReply@myserver.com"
    myMail.To="myemail@gmail.com"
    myMail.TextBody="This is a message."
    myMail.Send
    set myMail=nothing
%>

The message has been sent.
 </body>
</html>
 That's literally the whole thing.  it gives...

CDO.Message.1 error '80040220'
The "SendUsing" configuration value is invalid.
/cgi-bin/testemail.asp, line 14
So I googled.  First I changed the app pool user from ApplicationPoolIdentity to NetworkService, as many bloggers suggest.



No change.

Then I found some code that looks like this:

schema = "http://schemas.microsoft.com/cdo/configuration/"
  Set objFlds = objConf.Fields
  with objFlds
    .Item(schema & "sendusing") = 2
    .Item(schema & "smtpserver") = "smtp.gmail.com"
    .Item(schema & "smtpserverport") = 465
    .Item(schema & "smtpauthenticate") = 1
    .Item(schema & "sendusername") = "abc@def.com"
    .Item(schema & "sendpassword") = "qwerty"
    .Item(schema & "smtpusessl") = 1
    .Update
  End with
 and... no such luck.  Same Error.




...

Bryan Valencia is a contributing editor and founder of Visual Studio Journey.  He owns and operates Software Services, a web design and hosting company in Manteca, California.

Share This!

Contact Us

Name

Email *

Message *