asp-classic

configuring smtp in iis 7 for sending emails from classic asp application

元气小坏坏 提交于 2020-01-16 13:19:13
问题 I want to configure the smtp server on iis7. Its a website done on classic asp from which i am sending email. I get the error code as -2147220973. I have configured the email address and stmtp server name in IIS 7 Is there anything else need to be configured ? or what is the error code means ? 回答1: CDOSYS Error: Error Number: -2147220973 Error Source: CDO.Message.1 Error Description: The transport failed to connect to the server. Looks like IIS is not able to connect to SMTP server, make sure

Classic ASP number of weekdays between dates

眉间皱痕 提交于 2020-01-16 05:15:32
问题 Is there any way in Classic ASP VBScript to get the number of weekdays between 2 dates? Obviously, we have the DateDiff() function but this will pull back the total number of days but I would like to omit the weekends. 回答1: You're right, DateDiff() doesn't cover this but it can be used in conjunction with WeekDay() to work out if a Day falls on a weekend. By using DateDiff() to get the number of days we can then use a For loop to step through the days using DateAdd() to increment the day as

Classic ASP disconnected recordsets issue

社会主义新天地 提交于 2020-01-16 04:39:09
问题 So, I've been asked to update an old Classic ASP website. It did not use parameterized queries and there was very little input validation. To simplify things I wrote a helper function that opens a connection to the database, sets up a command object with any parameters, and creates a disconnected recordset [I think!?! :)] Here's the code: Function GetDiscRS(DatabaseName, SqlCommandText, ParameterArray) 'Declare our variables Dim discConn Dim discCmd Dim discRs 'Build connection string Dim

code critique - am I creating a Rube Goldberg machine?

懵懂的女人 提交于 2020-01-16 04:14:09
问题 I'm making a fair amount of calls to database tables via ADO. In the spirit of keeping things DRY, I wrote the following functions to return an array of values from a recordset. Is this hare brained? I use it mainly for grabbing a set of combo-box values and the like, never for enormous values. Example Usage (error handling removed for brevity): Function getEmployeeList() getEmployeeList= Array() strSQL = "SELECT emp_id, emp_name from employees" getEmployeeList = getSQLArray( strSQL, "|" )

ASP - SQL injection protection in the SELECT clause

浪子不回头ぞ 提交于 2020-01-16 04:04:16
问题 After getting great help in securing against SQL injection from classic ASP protection against SQL injection, I've encountered a major issue which cannot be solved using parameterized queries. name = Trim(Request.QueryString("name")) flds = Trim(Request.QueryString("flds")) sql = "set rowcount 0 select " & flds & " from [TABLE] where Name = '" & name & "'" From what I understand, a parameterized query will protect against SQL injection in the WHERE clause (in this case, the name field. flds

Display alert based on the background color of a drop down select option

北城余情 提交于 2020-01-16 04:02:48
问题 A have a drop down list which is being populated by a database, certain options in the list have a different background colour according to whether they have been banned or not. I would like to run a VB script which runs onChange which displays an alert if the user tries to select a user from the list which has a red background colour. For Example: Jim Bob ----> Red Background (Highlighted Red) Dave Tom then if the user tries to select Bob then it will bring up an alert and then focus the

session not working in classic asp on iis server 8

怎甘沉沦 提交于 2020-01-15 12:16:08
问题 My Session variable isn't initialising in classic asp webPages which is hosted on iis server 8, I have already configured the Session properties in session state feature view as well as in the Debugging Properties of ASP section of IIS server 8, please help me i m facing this problems after shifting my whole website from Windows server 2008 r2 with IIS7 to Windows server 2012 r2 with IIS8 on IIS 7 i haven't face any issue regarding this session variables initialiasation any help,would be

What's the correct way to specify file path in VBscript?

丶灬走出姿态 提交于 2020-01-15 10:15:08
问题 New to VBscript and spending way too much time trying to find the right way to open a file for reading. Whatever I've tried I always get "Path not found" error. This is the real path to my files: D:\InetPub\vhosts\lamardesigngroup.com\httpdocs\ The file that I am trying to run is: D:\InetPub\vhosts\lamardesigngroup.com\httpdocs\ifp\files.asp and I want to read this file: D:\InetPub\vhosts\lamardesigngroup.com\httpdocs\ifp\css\style.css Here is the code: Dim objFSO, strTextFile, strData,

Need to call a .Net Class library dll from a Classic ASP Page

旧街凉风 提交于 2020-01-15 06:51:27
问题 I need to call a .Net Class Library from a vbscript application I have written a C# class library and created a COM DLL component and a type library file I have successfully registered the dll and tlb on my local computer using C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe "C:\user\Visual Studio 2008\Projects\[Sample]\[Sample]\bin\Debug\[Sample].dll" /tlb "C:\user\Visual Studio 2008\Projects\[Sample]\[Sample]\bin\Debug\[Sample].tlb" The dll and the type library file are registered

CDO message wont send when delivery receipt requested

我是研究僧i 提交于 2020-01-15 05:37:25
问题 I'm writing an application in classic ASP (yes, please forgive me) that sends e-mails using Google Mail. I have it working just fine like this: Dim ObjSendMail Set ObjSendMail = CreateObject("CDO.Message") ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com" ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com