IIS ASP - Using "" in Code

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > July 2006 > Using "" in Code





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Using "" in Code
Mike

2006-07-24, 7:21 pm

I am querying a few fields in a DB table to get To, From, Subj,
Message, SMTP Server and Port Number info to use CDO to send a
preformatted message based on what is in this table.

All works well except on line.

MyMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= (rsEmailSettings.Fields.Item("NIDServer").Value)

If the table has MyServer.MyCompany.Com in it the output is:

MyMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= MyServer.MyCompany.Com

This does not work.

I need it to be:

MyMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "MyServer.MyCompany.Com"

Where MyServer.MyCompany.Com is enclosed in "".

I, for the life of me can't figure out how to write this line to do
it. Can someone give me some info on where to get the code or if you
know what I am missing, post it for me?

Thanks...

Mike...

Dave Anderson

2006-07-24, 7:21 pm

Mike wrote:
> If the table has MyServer.MyCompany.Com in it the output is:
>
> MyMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
> = MyServer.MyCompany.Com
>
> This does not work.
>
> I need it to be:
>
> MyMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
> = "MyServer.MyCompany.Com"
>
> Where MyServer.MyCompany.Com is enclosed in "".


In VBScript, you can escape quotes by doubling them. Thus, you want
something like this:

MyMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= ("""" & rsEmailSettings.Fields.Item("NIDServer").Value & """")


Likewise, in JScript:

MyMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= ("\"" + rsEmailSettings.Fields.Item("NIDServer").Value + "\"")



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com