Need help with scheduled task

Discussion in 'Classic ASP' started by samedayshop, May 1, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have the following .vbs program that I want to make a scheduled task:




    ' Open Database Connection


    Set Con = CreateObject( "ADODB.Connection" )


    Con.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=http://www.samedayshopping.net/_database/storeDB.mdb"


    todaysDate = DATE()


    todaysDatePlusSix = DATEADD("d",6,todaysDate)


    todaysWeekday = WEEKDAY(todaysDate)


    plusSixDays = todaysWeekday + 6


    IF plusSixDays > 7 THEN


    plusSixDays = plusSixDays -7


    END IF


    sqlString = "SELECT standard_store_id, standard_open_time, standard_close_time " &_


    "FROM standard_hours WHERE standard_weekday_number=" & plusSixDays


    SET RSstandard = Con.Execute( sqlString )


    WHILE NOT RSstandard.EOF


    sqlString = "UPDATE current_hours SET " &_


    "current_store_date=#" & todaysDatePlusSix & "#, " &_


    "current_open_time='" & RSstandard( "standard_open_time" ) & "', " &_


    "current_close_time='" & RSstandard( "standard_close_time" ) & "' " &_


    "WHERE current_weekday_number=" & plusSixDays & " " &_


    "AND current_store_id=" & RSstandard( "standard_store_id" )


    SET RScurrent = Con.Execute( sqlString )


    RSstandard.MoveNext


    WEND


    I sent a note to support and this is the response I received:


    You cannot call a vbscript file in the scheduled task. It has to be an
    asp, asp.net or in general, a page that you can pull up using a
    browser.



    Can anyone tell me what I need to do to get this scheduled task working?
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    you'll need to convert this to an ASP page.

    There are at least several problems in your script,

    1) the connection string is wrong.
    2) You'll have to wrap the code with

    <%

    %>

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Thanks Bruce....the script now works fine.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page