here is my code that I wrote to creat a mailing list !
I know there is something wrong !!! but I can not find where
Sub list()
Dim dteDOB As String
dteDOB = InputBox("Please enter your list date as 99 or 02", "Create List")
txtDOB = dteDOB
Dim fs, a
Dim dbcurr As DAO.Database
Set dbcurr = CurrentDb()
Dim rsSubjects As DAO.Recordset
Set rsSubjects = dbcurr.OpenRecordset("SELECT users.email FROM users WHERE year = '" & txtDOB & "';")
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\" & "grads" & txtDOB & "@domain.com.txt", True)
a.WriteLine "# Mailing List file"
a.WriteLine "#"
Do Until rsSubjects.EOF
a.WriteLine rsSubjects! [email]
rsSubjects.MoveNext
Loop
a.Close
End Sub
do I have to make some special settings in Access so it will work?
is it big deal to use DAO.Database & ADO.Database
what is the diffrence !
I use Access 2003
Thank you again for your time
HI :-)
|