Bringing a VBS and ASP script together

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fox

    Bringing a VBS and ASP script together

    I merged and modified these script which work perfectly fine
    as long as I use server.execute to access the VBS
    part (which is itself in another ASP file). When these
    I use a session variable to pass an email address from
    the database. I have had timeout problems
    and buffer problems and as I understand it, maybe
    a problem with changing the session variable too many
    times in one session. So I tried putting the two scripts
    on one page. When I do I get the error

    Microsoft VBScript compilation error '800a03ea'
    Syntax error
    /tournament-services/fbba/editor/cdo_setmail.asp , line 24
    SUB sendmail( fromWho, toWho, Subject, Body )

    Note that this is a large email list for a World Karate
    Tournament and is not a spam list. It has about 20,000
    recipients and I have never done anything like this
    hence the problems.

    How can I get these to work together on the same page?
    Here is the first script with the server.execute commented out
    since I do not want to use it if I can get this all on one page.
    I am hoping that doing that will end the other error problems.
    The first sript will have the second replace the server.execute.

    FIRST SCRIPT BEGIN:

    Server.ScriptTi meout = 6000
    Set objEmail= Server.CreateOb ject("ADODB.Con nection")
    objEmail.Open "DSN=Tournament s;",2

    Set CompetitorEmail = Server.CreateOb ject("ADODB.Rec ordset")
    sqltext = "SELECT Email FROM Vernon_email Where Email like '%@%' Order By
    Email;"

    CompetitorEmail .Open sqltext, objEmail
    Do While not CompetitorEmail .EOF
    If not address = CompetitorEmail ("Email") then
    'assign who to send to
    session("fromWh o") = CompetitorEmail ("email")

    'cycle through mail sender
    'server.execute ("CDO-vernon.asp")
    'the second script was placed here
    end if

    address = CompetitorEmail ("Email")
    CompetitorEmail .MoveNext
    Loop
    CompetitorEmail .close
    Set CompetitorEmail = Nothing
    END FIRST SCRIPT

    SECOND SCRIPT STARTS
    'I will remove the building of the HTML body.

    toWho = "dennis@connexi ons.net"
    Subject = "Karate Tounament NASKA/FST/FBBA: OSU! The SuperStar
    Invitational - Vernon Jones Jr."

    'it is this SUB that causes the syntax alert
    SUB sendmail( fromWho, toWho, Subject, Body )
    Dim objCDO
    Dim iConf
    Dim Flds
    Const cdoSendUsingPic kup = 2
    Set objCDO = Server.CreateOb ject("CDO.Messa ge")
    Set iConf = Server.CreateOb ject("CDO.Confi guration")

    Set Flds = iConf.Fields
    With Flds
    .Item(cdoSendUs ingMethod) = cdoSendUsingPic kup
    .Item("smtpserv erpickupdirecto ry")= "c:\Inetpub\mai lroot\pickup"
    .Item(cdoFlushB uffersOnWrite) = true
    .item(Response. Buffer) = False
    .Item(cdoSMTPSe rver) = "mailforward.co nnexions.net"
    .Update


    'The HTML Body is built here

    End With
    Set objCDO.Configur ation = iConf
    objCDO.From = fromWho
    objCDO.To = toWho
    objCDO.Subject = Subject
    objCDO.HTMLbody = strHTML
    'objCDO.AddAtta chment
    objCDO.Send
    END SUB

    If toWho <> "" THEN
    sendMail fromWho, toWho, Subject, Body

    END IF
    'Cleanup
    Set ObjCDO = Nothing
    Set iConf = Nothing
    Set Flds = Nothing

    END SECOND SCRIPT

    As mentioned above, when I put this second
    script into the middle of the first, the SUB errors
    as incorrect syntax. I am really over my head here
    and do not know what can be done to rectify this.

    Thanks for any pointers,

    Fox



  • Ray at

    #2
    Re: Bringing a VBS and ASP script together

    Can you show the code combined that is causing the error?

    Ray at home

    "Fox" <fox @ connexions .net> wrote in message
    news:uvGJnjpwDH A.2360@TK2MSFTN GP10.phx.gbl...[color=blue]
    > I merged and modified these script which work perfectly fine
    >
    > As mentioned above, when I put this second
    > script into the middle of the first, the SUB errors
    > as incorrect syntax. I am really over my head here
    > and do not know what can be done to rectify this.
    >
    > Thanks for any pointers,
    >
    > Fox
    >
    >
    >[/color]


    Comment

    • Fox

      #3
      Re: Bringing a VBS and ASP script together

      Thanks for taking a look Ray!
      Since the CDO part is not something I am familiar
      with, I do not know how to combine the sections
      in the one script. Here is what it would look like with
      a raw combining.
      Fox

      Server.ScriptTi meout = 6000
      Set objEmail= Server.CreateOb ject("ADODB.Con nection")
      objEmail.Open "DSN=Tournament s;",2

      Set CompetitorEmail = Server.CreateOb ject("ADODB.Rec ordset")
      sqltext = "SELECT Email FROM Vernon_email Where Email like '%@%' Order By
      Email;"
      CompetitorEmail .Open sqltext, objEmail

      Do While not CompetitorEmail .EOF
      If not address = CompetitorEmail ("Email") then
      'assign who to send to
      toWho = CompetitorEmail ("email")

      fromWho = sender@mydomain .com
      Subject = "Karate Tounament NASKA/FST/FBBA: OSU! The SuperStar
      Invitational - Vernon Jones Jr."

      'it is this SUB that causes the syntax alert
      SUB sendmail( fromWho, toWho, Subject, Body )
      Dim objCDO
      Dim iConf
      Dim Flds
      Const cdoSendUsingPic kup = 2
      Set objCDO = Server.CreateOb ject("CDO.Messa ge")
      Set iConf = Server.CreateOb ject("CDO.Confi guration")

      Set Flds = iConf.Fields
      With Flds
      .Item(cdoSendUs ingMethod) = cdoSendUsingPic kup
      .Item("smtpserv erpickupdirecto ry")= "c:\Inetpub\mai lroot\pickup"
      .Item(cdoFlushB uffersOnWrite) = true
      .Item(Response. Buffer) = False
      'probably not needed since using the pickup
      .Item(cdoSMTPSe rver) = "mailforward.co nnexions.net"
      .Update


      strHTML="<html> <head>" & vbCRLF
      strHTML = strHTML & "<title>KAR ATE TOURNAMENT: Florida's SuperStar
      Invitational (by Vernon Jones Jr.)</title></head>" & vbCRLF
      strHTML = strHTML & "<body bgcolor=000000 link=ffffff><ce nter>" & vbCRLF
      'rest of HTML body would be here
      End With

      Set objCDO.Configur ation = iConf
      objCDO.From = fromWho
      objCDO.To = toWho
      objCDO.Subject = Subject
      objCDO.HTMLbody = strHTML
      'objCDO.AddAtta chment
      objCDO.Send
      END SUB

      If toWho <> "" THEN
      sendMail fromWho, toWho, Subject, Body
      END IF

      'Cleanup
      Set ObjCDO = Nothing
      Set iConf = Nothing
      Set Flds = Nothing
      end if

      address = CompetitorEmail ("Email")
      CompetitorEmail .MoveNext
      Loop

      CompetitorEmail .close
      Set CompetitorEmail = Nothing




      "Ray at <%=sLocation% >" <myFirstNameATl ane34dotKOMM> wrote in message
      news:uWtzAWtwDH A.1764@TK2MSFTN GP10.phx.gbl...[color=blue]
      > Can you show the code combined that is causing the error?
      >
      > Ray at home[color=green]
      > > news:uvGJnjpwDH A.2360@TK2MSFTN GP10.phx.gbl...[/color]
      > "Fox" <fox @ connexions .net> wrote in message[/color]
      [color=blue][color=green]
      > > I merged and modified these script which work perfectly fine
      > >
      > > As mentioned above, when I put this second
      > > script into the middle of the first, the SUB errors
      > > as incorrect syntax. I am really over my head here
      > > and do not know what can be done to rectify this.
      > >
      > > Thanks for any pointers,
      > >
      > > Fox
      > >
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Fox

        #4
        Re: Bringing a VBS and ASP script together

        Some good news !
        I think I have it working. I am doing a test, sending to myself.
        I'm past 7,000 and it's still going. I already have a question
        which I will post after this finshes or crashes. But, in case
        anyone/Ray would be starting to help, I wanted to let you know
        that the script has been edited and improved to the point
        that it is now sending the mail.

        I Don't want to waste anyone's time.

        Thanks,
        Fox

        "Fox" <fox @ connexions .net> wrote in message
        news:uNZ71ztwDH A.2136@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Thanks for taking a look Ray!
        > Since the CDO part is not something I am familiar
        > with, I do not know how to combine the sections
        > in the one script. Here is what it would look like with
        > a raw combining.
        > Fox
        >
        > Server.ScriptTi meout = 6000
        > Set objEmail= Server.CreateOb ject("ADODB.Con nection")
        > objEmail.Open "DSN=Tournament s;",2
        >
        > Set CompetitorEmail = Server.CreateOb ject("ADODB.Rec ordset")
        > sqltext = "SELECT Email FROM Vernon_email Where Email like '%@%' Order By
        > Email;"
        > CompetitorEmail .Open sqltext, objEmail
        >
        > Do While not CompetitorEmail .EOF
        > If not address = CompetitorEmail ("Email") then
        > 'assign who to send to
        > toWho = CompetitorEmail ("email")
        >
        > fromWho = sender@mydomain .com
        > Subject = "Karate Tounament NASKA/FST/FBBA: OSU! The SuperStar
        > Invitational - Vernon Jones Jr."
        >
        > 'it is this SUB that causes the syntax alert
        > SUB sendmail( fromWho, toWho, Subject, Body )
        > Dim objCDO
        > Dim iConf
        > Dim Flds
        > Const cdoSendUsingPic kup = 2
        > Set objCDO = Server.CreateOb ject("CDO.Messa ge")
        > Set iConf = Server.CreateOb ject("CDO.Confi guration")
        >
        > Set Flds = iConf.Fields
        > With Flds
        > .Item(cdoSendUs ingMethod) = cdoSendUsingPic kup
        > .Item("smtpserv erpickupdirecto ry")=[/color]
        "c:\Inetpub\mai lroot\pickup"[color=blue]
        > .Item(cdoFlushB uffersOnWrite) = true
        > .Item(Response. Buffer) = False
        > 'probably not needed since using the pickup
        > .Item(cdoSMTPSe rver) = "mailforward.co nnexions.net"
        > .Update
        >
        >
        > strHTML="<html> <head>" & vbCRLF
        > strHTML = strHTML & "<title>KAR ATE TOURNAMENT: Florida's SuperStar
        > Invitational (by Vernon Jones Jr.)</title></head>" & vbCRLF
        > strHTML = strHTML & "<body bgcolor=000000 link=ffffff><ce nter>" & vbCRLF
        > 'rest of HTML body would be here
        > End With
        >
        > Set objCDO.Configur ation = iConf
        > objCDO.From = fromWho
        > objCDO.To = toWho
        > objCDO.Subject = Subject
        > objCDO.HTMLbody = strHTML
        > 'objCDO.AddAtta chment
        > objCDO.Send
        > END SUB
        >
        > If toWho <> "" THEN
        > sendMail fromWho, toWho, Subject, Body
        > END IF
        >
        > 'Cleanup
        > Set ObjCDO = Nothing
        > Set iConf = Nothing
        > Set Flds = Nothing
        > end if
        >
        > address = CompetitorEmail ("Email")
        > CompetitorEmail .MoveNext
        > Loop
        >
        > CompetitorEmail .close
        > Set CompetitorEmail = Nothing
        >
        >
        >
        >
        > "Ray at <%=sLocation% >" <myFirstNameATl ane34dotKOMM> wrote in message
        > news:uWtzAWtwDH A.1764@TK2MSFTN GP10.phx.gbl...[color=green]
        > > Can you show the code combined that is causing the error?
        > >
        > > Ray at home[color=darkred]
        > > > news:uvGJnjpwDH A.2360@TK2MSFTN GP10.phx.gbl...[/color]
        > > "Fox" <fox @ connexions .net> wrote in message[/color]
        >[color=green][color=darkred]
        > > > I merged and modified these script which work perfectly fine
        > > >
        > > > As mentioned above, when I put this second
        > > > script into the middle of the first, the SUB errors
        > > > as incorrect syntax. I am really over my head here
        > > > and do not know what can be done to rectify this.
        > > >
        > > > Thanks for any pointers,
        > > >
        > > > Fox
        > > >
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Aaron Bertrand [MVP]

          #5
          Re: Bringing a VBS and ASP script together

          > I think I have it working. I am doing a test, sending to myself.[color=blue]
          > I'm past 7,000[/color]

          Good grief, don't use ASP for this.


          --
          Aaron Bertrand
          SQL Server MVP



          Comment

          • Fox

            #6
            Re: Bringing a VBS and ASP script together

            Ok. This is the current state of this script. It seemed to
            be working perfectly fine until it did not stop (G)
            Apparently it started to loop and did not end at EOF.
            I am sure I could do something like put a count in there
            to stop it, but that would seem to be cheating when
            the EOF should be able to work on its own. Note
            that there were near 24,000 emails. I did a trial
            run with a small list of 84 emails and it worked fine.

            Something strange about the script. I made the entry
            for "smtpserverpick updirectory" and it errored saying
            that it needed PICKUP entry and there wasn't one. So
            I tried the complete Microsoft schema, with the same
            definition(path ) as you will see in the script. This it liked
            and found it to work. Is there some sensible reason for this ?
            When the script was on 2 pages, the entry
            "smtpserverpick updirectory" worked fine.

            Can you think of any reason why (maybe bad email address characters)
            or see anything in here that would have caused this
            process to not stop at EOF ? If not, if I can use something
            to stop it by more brute force, can you recommend what
            I can most count on?

            Thanks Fox

            <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
            NAME="CDO for Windows Library" -->
            <!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
            NAME="ADODB Type Library" -->

            Server.ScriptTi meout = 6000
            Set objEmail= Server.CreateOb ject("ADODB.Con nection")
            objEmail.Open "DSN=Tournament s;",2

            Set CompetitorEmail = Server.CreateOb ject("ADODB.Rec ordset")
            sqltext = "SELECT Email FROM Vernon_email Where Email like '%@%' Order By
            Email;"
            CompetitorEmail .Open sqltext, objEmail

            Do While not CompetitorEmail .EOF
            If not address = CompetitorEmail ("Email") then
            'assign who to send to
            fromWho = CompetitorEmail ("email")

            toWho = me@myplace.com
            Subject = "Karate Tounament NASKA/FST/FBBA: OSU! The SuperStar
            Invitational - Vernon Jones Jr."

            Dim objCDO
            Dim iConf
            Dim Flds
            'Const cdoSendUsingPic kup = 2
            Set objCDO = Server.CreateOb ject("CDO.Messa ge")
            Set iConf = Server.CreateOb ject("CDO.Confi guration")

            Set Flds = iConf.Fields
            With Flds
            .Item(cdoSendUs ingMethod) = cdoSendUsingPic kup

            ..Item("http://schemas.microso ft.com/cdo/configuration/smtpserverpicku pdirect
            ory")="C:\inetp ub\mailroot\pic kup"
            '.Item("smtpser verpickupdirect ory")=
            "c:\Inetpub\mai lroot\pickup"
            .Item(cdoFlushB uffersOnWrite) = true
            '.Item(Response .Buffer) = False
            'probably not needed since using the pickup
            .Item(cdoSMTPSe rver) = "mailforward.co nnexions.net"
            .Update


            strHTML="<html> <head>" & vbCRLF
            strHTML = strHTML & "<title>KAR ATE TOURNAMENT: Florida's SuperStar
            Invitational (by Vernon Jones Jr.)</title></head>" & vbCRLF
            strHTML = strHTML & "<body bgcolor=000000 link=ffffff><ce nter>" & vbCRLF
            'rest of HTML body would be here
            End With

            Set objCDO.Configur ation = iConf
            objCDO.From = fromWho
            objCDO.To = toWho
            objCDO.Subject = Subject
            objCDO.HTMLbody = strHTML
            'objCDO.AddAtta chment
            objCDO.Send

            'Cleanup
            Set ObjCDO = Nothing
            Set iConf = Nothing
            Set Flds = Nothing
            end if

            address = CompetitorEmail ("Email")
            CompetitorEmail .MoveNext
            Loop

            CompetitorEmail .close
            Set CompetitorEmail = Nothing





            "Fox" <fox @ connexions .net> wrote in message
            news:ub78hVuwDH A.3196@TK2MSFTN GP11.phx.gbl...[color=blue]
            > Some good news !
            > I think I have it working. I am doing a test, sending to myself.
            > I'm past 7,000 and it's still going. I already have a question
            > which I will post after this finshes or crashes. But, in case
            > anyone/Ray would be starting to help, I wanted to let you know
            > that the script has been edited and improved to the point
            > that it is now sending the mail.
            >
            > I Don't want to waste anyone's time.
            >
            > Thanks,
            > Fox
            >
            > "Fox" <fox @ connexions .net> wrote in message
            > news:uNZ71ztwDH A.2136@TK2MSFTN GP10.phx.gbl...[color=green]
            > > Thanks for taking a look Ray!
            > > Since the CDO part is not something I am familiar
            > > with, I do not know how to combine the sections
            > > in the one script. Here is what it would look like with
            > > a raw combining.
            > > Fox
            > >
            > > Server.ScriptTi meout = 6000
            > > Set objEmail= Server.CreateOb ject("ADODB.Con nection")
            > > objEmail.Open "DSN=Tournament s;",2
            > >
            > > Set CompetitorEmail = Server.CreateOb ject("ADODB.Rec ordset")
            > > sqltext = "SELECT Email FROM Vernon_email Where Email like '%@%' Order[/color][/color]
            By[color=blue][color=green]
            > > Email;"
            > > CompetitorEmail .Open sqltext, objEmail
            > >
            > > Do While not CompetitorEmail .EOF
            > > If not address = CompetitorEmail ("Email") then
            > > 'assign who to send to
            > > toWho = CompetitorEmail ("email")
            > >
            > > fromWho = sender@mydomain .com
            > > Subject = "Karate Tounament NASKA/FST/FBBA: OSU! The SuperStar
            > > Invitational - Vernon Jones Jr."
            > >
            > > 'it is this SUB that causes the syntax alert
            > > SUB sendmail( fromWho, toWho, Subject, Body )
            > > Dim objCDO
            > > Dim iConf
            > > Dim Flds
            > > Const cdoSendUsingPic kup = 2
            > > Set objCDO = Server.CreateOb ject("CDO.Messa ge")
            > > Set iConf = Server.CreateOb ject("CDO.Confi guration")
            > >
            > > Set Flds = iConf.Fields
            > > With Flds
            > > .Item(cdoSendUs ingMethod) = cdoSendUsingPic kup
            > > .Item("smtpserv erpickupdirecto ry")=[/color]
            > "c:\Inetpub\mai lroot\pickup"[color=green]
            > > .Item(cdoFlushB uffersOnWrite) = true
            > > .Item(Response. Buffer) = False
            > > 'probably not needed since using the pickup
            > > .Item(cdoSMTPSe rver) = "mailforward.co nnexions.net"
            > > .Update
            > >
            > >
            > > strHTML="<html> <head>" & vbCRLF
            > > strHTML = strHTML & "<title>KAR ATE TOURNAMENT: Florida's SuperStar
            > > Invitational (by Vernon Jones Jr.)</title></head>" & vbCRLF
            > > strHTML = strHTML & "<body bgcolor=000000 link=ffffff><ce nter>" &[/color][/color]
            vbCRLF[color=blue][color=green]
            > > 'rest of HTML body would be here
            > > End With
            > >
            > > Set objCDO.Configur ation = iConf
            > > objCDO.From = fromWho
            > > objCDO.To = toWho
            > > objCDO.Subject = Subject
            > > objCDO.HTMLbody = strHTML
            > > 'objCDO.AddAtta chment
            > > objCDO.Send
            > > END SUB
            > >
            > > If toWho <> "" THEN
            > > sendMail fromWho, toWho, Subject, Body
            > > END IF
            > >
            > > 'Cleanup
            > > Set ObjCDO = Nothing
            > > Set iConf = Nothing
            > > Set Flds = Nothing
            > > end if
            > >
            > > address = CompetitorEmail ("Email")
            > > CompetitorEmail .MoveNext
            > > Loop
            > >
            > > CompetitorEmail .close
            > > Set CompetitorEmail = Nothing
            > >
            > >
            > >
            > >
            > > "Ray at <%=sLocation% >" <myFirstNameATl ane34dotKOMM> wrote in message
            > > news:uWtzAWtwDH A.1764@TK2MSFTN GP10.phx.gbl...[color=darkred]
            > > > Can you show the code combined that is causing the error?
            > > >
            > > > Ray at home
            > > > > news:uvGJnjpwDH A.2360@TK2MSFTN GP10.phx.gbl...
            > > > "Fox" <fox @ connexions .net> wrote in message[/color]
            > >[color=darkred]
            > > > > I merged and modified these script which work perfectly fine
            > > > >
            > > > > As mentioned above, when I put this second
            > > > > script into the middle of the first, the SUB errors
            > > > > as incorrect syntax. I am really over my head here
            > > > > and do not know what can be done to rectify this.
            > > > >
            > > > > Thanks for any pointers,
            > > > >
            > > > > Fox
            > > > >
            > > > >
            > > > >
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Fox

              #7
              Re: Bringing a VBS and ASP script together

              Hiya, thanks for the heads up. I've seen that blip before, but had no
              alternative
              this time. Time was too short. But, I will try to learn a better way next
              time.
              Fortunately, I generally only have to send hundreds rather than thousands.
              This was by special request. But, it is still not done. I need to make sure
              that it sends once and then quits (G) Any ideas are welcomed.

              General Info for anyone who cares for the stats:
              It wrote near 500 per minute for a few minutes and then settled in
              at a consistent near 250 per minute for the next almost 30,000.
              I just wish it would quit at 23,897 like it was supposed to ;)

              Regards,
              Fox

              "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
              news:OaSG6KwwDH A.3408@tk2msftn gp13.phx.gbl...[color=blue][color=green]
              > > I think I have it working. I am doing a test, sending to myself.
              > > I'm past 7,000[/color]
              >
              > Good grief, don't use ASP for this.
              > http://www.aspfaq.com/2291
              >
              > --
              > Aaron Bertrand
              > SQL Server MVP
              > http://www.aspfaq.com/
              >
              >[/color]


              Comment

              • Aaron Bertrand - MVP

                #8
                Re: Bringing a VBS and ASP script together

                (a) use a VBS script, not an ASP page

                (b) grab 500 rows at a time, instead of all 23,000...

                --
                Aaron Bertrand
                SQL Server MVP





                "Fox" <fox @ connexions .net> wrote in message
                news:OzoDRtxwDH A.1764@TK2MSFTN GP10.phx.gbl...[color=blue]
                > Hiya, thanks for the heads up. I've seen that blip before, but had no
                > alternative
                > this time. Time was too short. But, I will try to learn a better way next
                > time.
                > Fortunately, I generally only have to send hundreds rather than thousands.
                > This was by special request. But, it is still not done. I need to make[/color]
                sure[color=blue]
                > that it sends once and then quits (G) Any ideas are welcomed.
                >
                > General Info for anyone who cares for the stats:
                > It wrote near 500 per minute for a few minutes and then settled in
                > at a consistent near 250 per minute for the next almost 30,000.
                > I just wish it would quit at 23,897 like it was supposed to ;)
                >
                > Regards,
                > Fox
                >
                > "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
                > news:OaSG6KwwDH A.3408@tk2msftn gp13.phx.gbl...[color=green][color=darkred]
                > > > I think I have it working. I am doing a test, sending to myself.
                > > > I'm past 7,000[/color]
                > >
                > > Good grief, don't use ASP for this.
                > > http://www.aspfaq.com/2291
                > >
                > > --
                > > Aaron Bertrand
                > > SQL Server MVP
                > > http://www.aspfaq.com/
                > >
                > >[/color]
                >
                >[/color]


                Comment

                • Fox

                  #9
                  Re: Bringing a VBS and ASP script together

                  I will look into that. But for now, I do not know how to
                  create a script that will do that. I do not know how to
                  access SQL server in VBS only in ASP/ADO.
                  Also, I do not know how to select to get only
                  500 hundred at a time, If it is easy enough that
                  you can point me to a place online to read
                  or if a sample is possible, then I will surely try
                  this right now.

                  The client I have to do this for is about to kill me.
                  Must go out shortly, very shortly.

                  Regards,
                  Fox

                  "Aaron Bertrand - MVP" <aaron@TRASHasp faq.com> wrote in message
                  news:eJCozvxwDH A.2408@tk2msftn gp13.phx.gbl...[color=blue]
                  > (a) use a VBS script, not an ASP page
                  >
                  > (b) grab 500 rows at a time, instead of all 23,000...
                  >
                  > --
                  > Aaron Bertrand
                  > SQL Server MVP
                  > http://www.aspfaq.com/
                  >
                  >
                  >
                  >
                  > "Fox" <fox @ connexions .net> wrote in message
                  > news:OzoDRtxwDH A.1764@TK2MSFTN GP10.phx.gbl...[color=green]
                  > > Hiya, thanks for the heads up. I've seen that blip before, but had no
                  > > alternative
                  > > this time. Time was too short. But, I will try to learn a better way[/color][/color]
                  next[color=blue][color=green]
                  > > time.
                  > > Fortunately, I generally only have to send hundreds rather than[/color][/color]
                  thousands.[color=blue][color=green]
                  > > This was by special request. But, it is still not done. I need to make[/color]
                  > sure[color=green]
                  > > that it sends once and then quits (G) Any ideas are welcomed.
                  > >
                  > > General Info for anyone who cares for the stats:
                  > > It wrote near 500 per minute for a few minutes and then settled in
                  > > at a consistent near 250 per minute for the next almost 30,000.
                  > > I just wish it would quit at 23,897 like it was supposed to ;)
                  > >
                  > > Regards,
                  > > Fox
                  > >
                  > > "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
                  > > news:OaSG6KwwDH A.3408@tk2msftn gp13.phx.gbl...[color=darkred]
                  > > > > I think I have it working. I am doing a test, sending to myself.
                  > > > > I'm past 7,000
                  > > >
                  > > > Good grief, don't use ASP for this.
                  > > > http://www.aspfaq.com/2291
                  > > >
                  > > > --
                  > > > Aaron Bertrand
                  > > > SQL Server MVP
                  > > > http://www.aspfaq.com/
                  > > >
                  > > >[/color]
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  • Fox

                    #10
                    Re: Bringing a VBS and ASP script together

                    BTW, I have been reading the links from the linked blip
                    you sent. It is over my head at this point. Hopefully
                    I can get someone locally that understands to sit
                    down with me to help me get a bit more advanced.

                    Regards,
                    Fox

                    "Aaron Bertrand - MVP" <aaron@TRASHasp faq.com> wrote in message
                    news:eJCozvxwDH A.2408@tk2msftn gp13.phx.gbl...[color=blue]
                    > (a) use a VBS script, not an ASP page
                    >
                    > (b) grab 500 rows at a time, instead of all 23,000...
                    >
                    > --
                    > Aaron Bertrand
                    > SQL Server MVP
                    > http://www.aspfaq.com/
                    >
                    >
                    >
                    >
                    > "Fox" <fox @ connexions .net> wrote in message
                    > news:OzoDRtxwDH A.1764@TK2MSFTN GP10.phx.gbl...[color=green]
                    > > Hiya, thanks for the heads up. I've seen that blip before, but had no
                    > > alternative
                    > > this time. Time was too short. But, I will try to learn a better way[/color][/color]
                    next[color=blue][color=green]
                    > > time.
                    > > Fortunately, I generally only have to send hundreds rather than[/color][/color]
                    thousands.[color=blue][color=green]
                    > > This was by special request. But, it is still not done. I need to make[/color]
                    > sure[color=green]
                    > > that it sends once and then quits (G) Any ideas are welcomed.
                    > >
                    > > General Info for anyone who cares for the stats:
                    > > It wrote near 500 per minute for a few minutes and then settled in
                    > > at a consistent near 250 per minute for the next almost 30,000.
                    > > I just wish it would quit at 23,897 like it was supposed to ;)
                    > >
                    > > Regards,
                    > > Fox
                    > >
                    > > "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
                    > > news:OaSG6KwwDH A.3408@tk2msftn gp13.phx.gbl...[color=darkred]
                    > > > > I think I have it working. I am doing a test, sending to myself.
                    > > > > I'm past 7,000
                    > > >
                    > > > Good grief, don't use ASP for this.
                    > > > http://www.aspfaq.com/2291
                    > > >
                    > > > --
                    > > > Aaron Bertrand
                    > > > SQL Server MVP
                    > > > http://www.aspfaq.com/
                    > > >
                    > > >[/color]
                    > >
                    > >[/color]
                    >
                    >[/color]


                    Comment

                    • Aaron Bertrand - MVP

                      #11
                      Re: Bringing a VBS and ASP script together

                      > I do not know how to[color=blue]
                      > access SQL server in VBS only in ASP/ADO.[/color]

                      Same as in ASP, except lose any server. prefixes on object creations, and
                      remove any instances of ASP intrinsics (e.g. response, session, etc).
                      [color=blue]
                      > Also, I do not know how to select to get only
                      > 500 hundred at a time[/color]

                      Does your table have a primary key?

                      If so, add a column that indicates whether mail has been sent (or, better
                      yet, stuff all of the rows into a #temp table with such a column).

                      Then, loop over this pseudo-code


                      SELECT TOP 500 email_address, othercolumns FROM #tablename WHERE sent = 0
                      ORDER BY primarykey
                      ' if not rs.eof
                      ' begin transaction
                      ' send mails
                      UPDATE #tablename SET sent = 1 WHERE primarykey IN (SELECT TOP 500
                      primarykey FROM #tablename WHERE sent = 0 ORDER BY primarykey)
                      ' commit transaction
                      ' else
                      ' you're done

                      --
                      Aaron Bertrand
                      SQL Server MVP



                      Comment

                      • Fox

                        #12
                        Re: Bringing a VBS and ASP script together

                        Thanks, actually I basically understand this.
                        and it is a possibility I can get it to work.
                        The only place that is confusing me is where
                        you have the single apostrophes. I understand
                        them in ASP to be comments. But all of yours
                        look like commands except the "your're done".
                        Can you explain shortly about the sectioins with
                        apostrophe and I think from there I can manage.
                        Are all but the "you're done" literal commands ?
                        Remember, I have limited knowledge, sorry !

                        Thanks,
                        Fox

                        "Aaron Bertrand - MVP" <aaron@TRASHasp faq.com> wrote in message
                        news:#mSnCEywDH A.2136@TK2MSFTN GP10.phx.gbl...[color=blue][color=green]
                        > > I do not know how to
                        > > access SQL server in VBS only in ASP/ADO.[/color]
                        >
                        > Same as in ASP, except lose any server. prefixes on object creations, and
                        > remove any instances of ASP intrinsics (e.g. response, session, etc).
                        >[color=green]
                        > > Also, I do not know how to select to get only
                        > > 500 hundred at a time[/color]
                        >
                        > Does your table have a primary key?
                        >
                        > If so, add a column that indicates whether mail has been sent (or, better
                        > yet, stuff all of the rows into a #temp table with such a column).
                        >
                        > Then, loop over this pseudo-code
                        >
                        >
                        > SELECT TOP 500 email_address, othercolumns FROM #tablename WHERE sent = 0
                        > ORDER BY primarykey
                        > ' if not rs.eof
                        > ' begin transaction
                        > ' send mails
                        > UPDATE #tablename SET sent = 1 WHERE primarykey IN (SELECT TOP 500
                        > primarykey FROM #tablename WHERE sent = 0 ORDER BY primarykey)
                        > ' commit transaction
                        > ' else
                        > ' you're done
                        >
                        > --
                        > Aaron Bertrand
                        > SQL Server MVP
                        > http://www.aspfaq.com/
                        >
                        >[/color]


                        Comment

                        • Fox

                          #13
                          Re: Bringing a VBS and ASP script together

                          If you are still there ;)))
                          Is "primary key" literal or needing a name.
                          I have not worked with primary keys.
                          In comparison I worked with Paradox years
                          ago and I think it was quite different.

                          Fox

                          "Aaron Bertrand - MVP" <aaron@TRASHasp faq.com> wrote in message
                          news:#mSnCEywDH A.2136@TK2MSFTN GP10.phx.gbl...[color=blue][color=green]
                          > > I do not know how to
                          > > access SQL server in VBS only in ASP/ADO.[/color]
                          >
                          > Same as in ASP, except lose any server. prefixes on object creations, and
                          > remove any instances of ASP intrinsics (e.g. response, session, etc).
                          >[color=green]
                          > > Also, I do not know how to select to get only
                          > > 500 hundred at a time[/color]
                          >
                          > Does your table have a primary key?
                          >
                          > If so, add a column that indicates whether mail has been sent (or, better
                          > yet, stuff all of the rows into a #temp table with such a column).
                          >
                          > Then, loop over this pseudo-code
                          >
                          >
                          > SELECT TOP 500 email_address, othercolumns FROM #tablename WHERE sent = 0
                          > ORDER BY primarykey
                          > ' if not rs.eof
                          > ' begin transaction
                          > ' send mails
                          > UPDATE #tablename SET sent = 1 WHERE primarykey IN (SELECT TOP 500
                          > primarykey FROM #tablename WHERE sent = 0 ORDER BY primarykey)
                          > ' commit transaction
                          > ' else
                          > ' you're done
                          >
                          > --
                          > Aaron Bertrand
                          > SQL Server MVP
                          > http://www.aspfaq.com/
                          >
                          >[/color]


                          Comment

                          • Aaron Bertrand - MVP

                            #14
                            Re: Bringing a VBS and ASP script together

                            > Is "primary key" literal or needing a name.

                            Primary key needs a name. Do you have a column where one specific value can
                            represent exactly one row?

                            --
                            Aaron Bertrand
                            SQL Server MVP



                            Comment

                            • Aaron Bertrand - MVP

                              #15
                              Re: Bringing a VBS and ASP script together

                              The comments represent pseudo-code. You're going to have to do some of this
                              work yourself; no offense, but most of us are a little too busy to code your
                              solution for you, end-to-end. Having limited knowledge should not be used
                              as such a crutch or excuse... having a requirement, and stumbling along the
                              way, is the best reason to learn.

                              --
                              Aaron Bertrand
                              SQL Server MVP





                              "Fox" <fox @ connexions .net> wrote in message
                              news:O9uEGPywDH A.1760@TK2MSFTN GP10.phx.gbl...[color=blue]
                              > Thanks, actually I basically understand this.
                              > and it is a possibility I can get it to work.
                              > The only place that is confusing me is where
                              > you have the single apostrophes. I understand
                              > them in ASP to be comments. But all of yours
                              > look like commands except the "your're done".
                              > Can you explain shortly about the sectioins with
                              > apostrophe and I think from there I can manage.[/color]


                              Comment

                              Working...