Hi everyone<\/p>\n
I’m writing a tiny database that will be shared across 20 people, I’ve got the back end in MS SQL and now want to write the front end in Access (then roll out via a run time).<\/p>\n
I think I’m being stupid here, I’ve written all my SQL statements ready to paste in to buttons and so on. Am I right in thinking I should be pasting my SQL code within an Access query, and then assigning that to a button? As when I’ve run it, it errors. For example a bit of code to update a drop down list:<\/p>\n
USE Database1;
\ndelete from [table1].[dbo].counsel;
\ninsert into [database1].[dbo].counsel (counsel) select name FROM [database2].[dbo].[centralcontact] where used=‘1’<\/p>\n
I only have a single ODBC connection to Database1 (Didn’t know if I needed another connection to database2)<\/p>","upvoteCount":4,"answerCount":18,"datePublished":"2015-06-10T12:52:07.000Z","author":{"@type":"Person","name":"darrenhillyer","url":"https://community.spiceworks.com/u/darrenhillyer"},"acceptedAnswer":{"@type":"Answer","text":"
Are your users on your domain? If so, you can push out the DSNs via Group Policy.<\/p>","upvoteCount":1,"datePublished":"2015-06-12T13:54:07.000Z","url":"https://community.spiceworks.com/t/access-2010-ms-sql/410710/12","author":{"@type":"Person","name":"robert-for-microsoft","url":"https://community.spiceworks.com/u/robert-for-microsoft"}},"suggestedAnswer":[{"@type":"Answer","text":"
Hi everyone<\/p>\n
I’m writing a tiny database that will be shared across 20 people, I’ve got the back end in MS SQL and now want to write the front end in Access (then roll out via a run time).<\/p>\n
I think I’m being stupid here, I’ve written all my SQL statements ready to paste in to buttons and so on. Am I right in thinking I should be pasting my SQL code within an Access query, and then assigning that to a button? As when I’ve run it, it errors. For example a bit of code to update a drop down list:<\/p>\n
USE Database1;
\ndelete from [table1].[dbo].counsel;
\ninsert into [database1].[dbo].counsel (counsel) select name FROM [database2].[dbo].[centralcontact] where used=‘1’<\/p>\n
I only have a single ODBC connection to Database1 (Didn’t know if I needed another connection to database2)<\/p>","upvoteCount":4,"datePublished":"2015-06-10T12:52:07.000Z","url":"https://community.spiceworks.com/t/access-2010-ms-sql/410710/1","author":{"@type":"Person","name":"darrenhillyer","url":"https://community.spiceworks.com/u/darrenhillyer"}},{"@type":"Answer","text":"
I don’t think you need the “USE” statement in Access.<\/p>","upvoteCount":2,"datePublished":"2015-06-10T12:57:01.000Z","url":"https://community.spiceworks.com/t/access-2010-ms-sql/410710/2","author":{"@type":"Person","name":"sqlrage","url":"https://community.spiceworks.com/u/sqlrage"}},{"@type":"Answer","text":"
I know a bit of sql, and I know a bit of access, but, I’ve never connected them both before<\/p>","upvoteCount":1,"datePublished":"2015-06-10T12:58:40.000Z","url":"https://community.spiceworks.com/t/access-2010-ms-sql/410710/3","author":{"@type":"Person","name":"darrenhillyer","url":"https://community.spiceworks.com/u/darrenhillyer"}},{"@type":"Answer","text":"
Also, I don’t think you can have multiple queries run like that. Save them as separate queries, and call them in either VBA or a macro.<\/p>","upvoteCount":2,"datePublished":"2015-06-10T12:58:50.000Z","url":"https://community.spiceworks.com/t/access-2010-ms-sql/410710/4","author":{"@type":"Person","name":"sqlrage","url":"https://community.spiceworks.com/u/sqlrage"}},{"@type":"Answer","text":"
Blurghhh, I’m wondering if it’s quicker to write it all in access and share the data file out<\/p>","upvoteCount":1,"datePublished":"2015-06-10T13:00:34.000Z","url":"https://community.spiceworks.com/t/access-2010-ms-sql/410710/5","author":{"@type":"Person","name":"darrenhillyer","url":"https://community.spiceworks.com/u/darrenhillyer"}},{"@type":"Answer","text":"
Never worked with SQL before, but won’t linking the tables through get external data do the trick?<\/p>","upvoteCount":2,"datePublished":"2015-06-10T13:17:15.000Z","url":"https://community.spiceworks.com/t/access-2010-ms-sql/410710/6","author":{"@type":"Person","name":"kevinhughes2","url":"https://community.spiceworks.com/u/kevinhughes2"}},{"@type":"Answer","text":"
Hi guys<\/p>\n
Found what to do, I’ve come up against a limitation of access only being able to run a single sql statement at a time within the query, crazy!<\/p>","upvoteCount":1,"datePublished":"2015-06-11T07:26:13.000Z","url":"https://community.spiceworks.com/t/access-2010-ms-sql/410710/7","author":{"@type":"Person","name":"darrenhillyer","url":"https://community.spiceworks.com/u/darrenhillyer"}},{"@type":"Answer","text":"