syntax for vbs connection

Results 1 to 3 of 3

Thread: syntax for vbs connection

  1. #1
    Join Date
    Dec 1969

    Default syntax for vbs connection

    dim conn<BR>dim rs<BR>dim sql<BR>Dim objCDO<BR>Set objCDO = CreateObject("CDO.Message")<BR>Set conn = CreateObject("ADODB.Connection")<BR>------WHAT SHOULD BE THE SYNTAX FOR VBS FILE?? IT DOES NOT LIKE MAPPATH-------------<BR>conn.Open "DBQ=" & MapPath("../Data/arido.mdb") _<BR>& ";Driver={Microsoft Access Driver (*.mdb)};"<BR>Set RS = CreateObject("ADODB.Recordset")<BR>SQL="SELECT * FROM aridoUsers"<BR> SQL,conn,2,3<BR>If not RS.eof then<BR>do while not rs.eof<BR><BR>With objCDO<BR>.To=rs.fields("email")<BR>.From="adminis"<BR>.Subject="Five more days to Access the Course"<BR>.TextBody="Your password will expire in 5 days!!!!"<BR>.Send<BR>End With<BR>loop<BR>end if<BR>Set objCDO = Nothing

  2. #2
    Join Date
    Dec 1969

    Default Correct

    Standard .vbs scripts do not run under IIS and thus MapPath doesn&#039;t apply.<BR><BR>DBQ=c:myfolderarido.mdb

  3. #3
    Join Date
    Dec 1969
    Los Angeles, CA

    Default I would like to add

    the way you have your code ou dont need the "If not RS.eof then"<BR><BR>your do loop should take care of it<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts