'Access SQL server from oputlook
Sub AccessSQLServer(Item As Outlook.MailItem)
Set con = CreateObject("ADODB.Connection")
con.Open "driver={SQL Server};Uid=sa;server=myserv;pwd=mypass;database=mydb;"
Set rs = CreateObject("ADODB.Recordset")
rs.ActiveConnection = con
rs.Open "SELECT * FROM MyTable"
Do While Not rs.EOF
MsgBox rs("id")
rs.MoveNext
Loop
End Sub
more...
No comments:
Post a Comment