473,396 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Bringing a VBS and ASP script together

Fox
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.ScriptTimeout = 6000
Set objEmail= Server.CreateObject("ADODB.Connection")
objEmail.Open "DSN=Tournaments;",2

Set CompetitorEmail = Server.CreateObject("ADODB.Recordset")
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("fromWho") = 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 = "de****@connexions.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 cdoSendUsingPickup = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPickup
.Item("smtpserverpickupdirectory")= "c:\Inetpub\mailroot\pickup"
.Item(cdoFlushBuffersOnWrite) = true
.item(Response.Buffer) = False
.Item(cdoSMTPServer) = "mailforward.connexions.net"
.Update
'The HTML Body is built here

End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.HTMLbody = strHTML
'objCDO.AddAttachment
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

Jul 19 '05 #1
16 3972
Can you show the code combined that is causing the error?

Ray at home

"Fox" <fox @ connexions .net> wrote in message
news:uv**************@TK2MSFTNGP10.phx.gbl...
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

Jul 19 '05 #2
Fox
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.ScriptTimeout = 6000
Set objEmail= Server.CreateObject("ADODB.Connection")
objEmail.Open "DSN=Tournaments;",2

Set CompetitorEmail = Server.CreateObject("ADODB.Recordset")
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 = se****@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 cdoSendUsingPickup = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPickup
.Item("smtpserverpickupdirectory")= "c:\Inetpub\mailroot\pickup"
.Item(cdoFlushBuffersOnWrite) = true
.Item(Response.Buffer) = False
'probably not needed since using the pickup
.Item(cdoSMTPServer) = "mailforward.connexions.net"
.Update
strHTML="<html><head>" & vbCRLF
strHTML = strHTML & "<title>KARATE TOURNAMENT: Florida's SuperStar
Invitational (by Vernon Jones Jr.)</title></head>" & vbCRLF
strHTML = strHTML & "<body bgcolor=000000 link=ffffff><center>" & vbCRLF
'rest of HTML body would be here
End With

Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.HTMLbody = strHTML
'objCDO.AddAttachment
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%>" <myFirstNameATlane34dotKOMM> wrote in message
news:uW**************@TK2MSFTNGP10.phx.gbl...
Can you show the code combined that is causing the error?

Ray at home
news:uv**************@TK2MSFTNGP10.phx.gbl...

"Fox" <fox @ connexions .net> wrote in message

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


Jul 19 '05 #3
Fox
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:uN**************@TK2MSFTNGP10.phx.gbl...
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.ScriptTimeout = 6000
Set objEmail= Server.CreateObject("ADODB.Connection")
objEmail.Open "DSN=Tournaments;",2

Set CompetitorEmail = Server.CreateObject("ADODB.Recordset")
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 = se****@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 cdoSendUsingPickup = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPickup
.Item("smtpserverpickupdirectory")= "c:\Inetpub\mailroot\pickup" .Item(cdoFlushBuffersOnWrite) = true
.Item(Response.Buffer) = False
'probably not needed since using the pickup
.Item(cdoSMTPServer) = "mailforward.connexions.net"
.Update
strHTML="<html><head>" & vbCRLF
strHTML = strHTML & "<title>KARATE TOURNAMENT: Florida's SuperStar
Invitational (by Vernon Jones Jr.)</title></head>" & vbCRLF
strHTML = strHTML & "<body bgcolor=000000 link=ffffff><center>" & vbCRLF
'rest of HTML body would be here
End With

Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.HTMLbody = strHTML
'objCDO.AddAttachment
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%>" <myFirstNameATlane34dotKOMM> wrote in message
news:uW**************@TK2MSFTNGP10.phx.gbl...
Can you show the code combined that is causing the error?

Ray at home
news:uv**************@TK2MSFTNGP10.phx.gbl...

"Fox" <fox @ connexions .net> wrote in message

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



Jul 19 '05 #4
> 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/
Jul 19 '05 #5
Fox
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 "smtpserverpickupdirectory" 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
"smtpserverpickupdirectory" 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.ScriptTimeout = 6000
Set objEmail= Server.CreateObject("ADODB.Connection")
objEmail.Open "DSN=Tournaments;",2

Set CompetitorEmail = Server.CreateObject("ADODB.Recordset")
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 cdoSendUsingPickup = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPickup

..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirect
ory")="C:\inetpub\mailroot\pickup"
'.Item("smtpserverpickupdirectory")=
"c:\Inetpub\mailroot\pickup"
.Item(cdoFlushBuffersOnWrite) = true
'.Item(Response.Buffer) = False
'probably not needed since using the pickup
.Item(cdoSMTPServer) = "mailforward.connexions.net"
.Update
strHTML="<html><head>" & vbCRLF
strHTML = strHTML & "<title>KARATE TOURNAMENT: Florida's SuperStar
Invitational (by Vernon Jones Jr.)</title></head>" & vbCRLF
strHTML = strHTML & "<body bgcolor=000000 link=ffffff><center>" & vbCRLF
'rest of HTML body would be here
End With

Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.HTMLbody = strHTML
'objCDO.AddAttachment
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:ub**************@TK2MSFTNGP11.phx.gbl...
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:uN**************@TK2MSFTNGP10.phx.gbl...
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.ScriptTimeout = 6000
Set objEmail= Server.CreateObject("ADODB.Connection")
objEmail.Open "DSN=Tournaments;",2

Set CompetitorEmail = Server.CreateObject("ADODB.Recordset")
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 = se****@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 cdoSendUsingPickup = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPickup
.Item("smtpserverpickupdirectory")=

"c:\Inetpub\mailroot\pickup"
.Item(cdoFlushBuffersOnWrite) = true
.Item(Response.Buffer) = False
'probably not needed since using the pickup
.Item(cdoSMTPServer) = "mailforward.connexions.net"
.Update
strHTML="<html><head>" & vbCRLF
strHTML = strHTML & "<title>KARATE TOURNAMENT: Florida's SuperStar
Invitational (by Vernon Jones Jr.)</title></head>" & vbCRLF
strHTML = strHTML & "<body bgcolor=000000 link=ffffff><center>" & vbCRLF 'rest of HTML body would be here
End With

Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.HTMLbody = strHTML
'objCDO.AddAttachment
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%>" <myFirstNameATlane34dotKOMM> wrote in message
news:uW**************@TK2MSFTNGP10.phx.gbl...
Can you show the code combined that is causing the error?

Ray at home
> news:uv**************@TK2MSFTNGP10.phx.gbl...
"Fox" <fox @ connexions .net> wrote in message

> 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
>
>
>



Jul 19 '05 #6
Fox
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]" <aa***@TRASHaspfaq.com> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
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/

Jul 19 '05 #7
(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:Oz**************@TK2MSFTNGP10.phx.gbl...
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]" <aa***@TRASHaspfaq.com> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
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/


Jul 19 '05 #8
Fox
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" <aa***@TRASHaspfaq.com> wrote in message
news:eJ**************@tk2msftngp13.phx.gbl...
(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:Oz**************@TK2MSFTNGP10.phx.gbl...
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]" <aa***@TRASHaspfaq.com> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
> 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/



Jul 19 '05 #9
Fox
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" <aa***@TRASHaspfaq.com> wrote in message
news:eJ**************@tk2msftngp13.phx.gbl...
(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:Oz**************@TK2MSFTNGP10.phx.gbl...
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]" <aa***@TRASHaspfaq.com> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
> 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/



Jul 19 '05 #10
> I do not know how to
access SQL server in VBS only in ASP/ADO.
Same as in ASP, except lose any server. prefixes on object creations, and
remove any instances of ASP intrinsics (e.g. response, session, etc).
Also, I do not know how to select to get only
500 hundred at a time


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/
Jul 19 '05 #11
Fox
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" <aa***@TRASHaspfaq.com> wrote in message
news:#m**************@TK2MSFTNGP10.phx.gbl...
I do not know how to
access SQL server in VBS only in ASP/ADO.


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


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/

Jul 19 '05 #12
Fox
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" <aa***@TRASHaspfaq.com> wrote in message
news:#m**************@TK2MSFTNGP10.phx.gbl...
I do not know how to
access SQL server in VBS only in ASP/ADO.


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


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/

Jul 19 '05 #13
> 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
http://www.aspfaq.com/
Jul 19 '05 #14
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
http://www.aspfaq.com/


"Fox" <fox @ connexions .net> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
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.

Jul 19 '05 #15
Fox
Thanks for all your help. This is the info I needed. I surely understand
and I thank you and respect your willingness to help as much as you have.
Now I am more sure that I know what I am looking at and I know what
I will need to do (G)

Regards,
Fox

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:e9*************@tk2msftngp13.phx.gbl...
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
http://www.aspfaq.com/


"Fox" <fox @ connexions .net> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
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.


Jul 19 '05 #16
Fox
Yes, it is the ID column, auto-generated.
Is the column the name ?

I am sorry to be a pest. Believe me, I am not shirking
the work, I have been working on this script for a week
and spending most nights awake as well. I am definitely
trying to learn and trying hard to do so. Your help has
been immeasurable and greatly appreciated. As you
can understand, abandoning all that I finally figured out is
a major change and this process has to be done today.
I am sorry if I appeared to be asking for too much.
I did not mean to.

Thanks,
Fox

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:e8**************@TK2MSFTNGP09.phx.gbl...
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
http://www.aspfaq.com/

Jul 19 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sarah | last post by:
hi all. first time poster so please forgive and maybe direct me to correct group if this is wrong place. tia. i'm after constructing a PHP script to fit within my nuke modules to do this.. ...
4
by: hupjack | last post by:
I finally joined the millions of cell phone users out there. I'm the 2nd phone on what is now a family share plan. (Our two cell phones use minutes from a central 400 minute peak time pool.)...
1
by: JStrummer | last post by:
I just put together a PHP mailing list sign-up page that posts to a mySQL DB. The PHP script prevents INSERTs when the email address is already located in the database. Problem: I need to import...
6
by: Mike Daniel | last post by:
I am attempting to use document.write(pageVar) that displays a new html page within a pop-up window and the popup is failing. Also note that pageVar is a complete HTML page containing other java...
1
by: Allen | last post by:
I am trying to add an additional photo/hyperlink to the company web site (I didn't create it) without any luck. The mouseover feature 'highlights' pics by swapping them with another pic using this...
4
by: 28tommy | last post by:
Hi, I'm trying to find scripts in html source of a page retrieved from the web. I'm trying to use the following rule: match = re.compile('<script + src=+>') I'm testing it on a page that...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
3
by: papalarge | last post by:
I have a VB.NET application that consists of a toolbar and a subwindow that I want to function together and not independently. So when I give focus to one, I want to make sure that the other is...
18
by: orfiyus | last post by:
Hi I am writing a php script that contains a bunch of links. Each link when clicked redirects to the same page however where the clicked link once was is now a textfield. The user then types...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.