You need to change the connection line tocnn.Open("Provider=SQLOLEDB;Data Source=SERVER_NAME;database=DB_NAME;uid=UID;pwd=PWD;")
There will quite possibly be changes to your SQL as well. The Differences Between Microsoft SQL Server and Microsoft Access Query Syntax are listed in that article from Microsoft.