J
janetb
I have an odbc connection to an sql database backend. Everything's working
fine. But, just for a small section of code, is it possible to modify the
code below and connect to another sql database in another city for which I
have an account and password?
Dim mySql as string
mySql="select email, name from dbo_table where eid=" & forms!myForm!eid
Set db = CurrentDb() 'Probably need to change it here.....
Set rs = db.OpenRecordset(mySql, dbOpenDynaset, dbSeeChanges)
Do While Not rs.EOF
strMsg = "This is a final reminder blah....." & _
vbCrLf & Trim(rs("name"))
DoCmd.SendObject acSendNoObject, , , strTo, strCC, , strSubject,
strMsg, False
rs.MoveNext
rs.Close
Loop
DoCmd.Close
fine. But, just for a small section of code, is it possible to modify the
code below and connect to another sql database in another city for which I
have an account and password?
Dim mySql as string
mySql="select email, name from dbo_table where eid=" & forms!myForm!eid
Set db = CurrentDb() 'Probably need to change it here.....
Set rs = db.OpenRecordset(mySql, dbOpenDynaset, dbSeeChanges)
Do While Not rs.EOF
strMsg = "This is a final reminder blah....." & _
vbCrLf & Trim(rs("name"))
DoCmd.SendObject acSendNoObject, , , strTo, strCC, , strSubject,
strMsg, False
rs.MoveNext
rs.Close
Loop
DoCmd.Close