Write Access Client App for SQL Server 2005 Backend - sql-server

I'm writing an inventory/payroll system, and I'm storing all the records on a remote server running SQL Server 2005 on Windows Server 2008 R2. I was wondering how I could start writing forms(very basic) in MS-ACCESS 2010 to upload things to the database. I just want to test it out to make sure that once I implement the entire database, things will work smoothly and without error. I want to figure out how to just make a single form that will be connected to the database, right now the form will just be a simple single text input with a submit button, that will be uploading barcodes(strings not images).
If I need to clarify anything, please just ask.
Thanks in advance for any help

Microsoft has tons of useful "Getting Started" articles.
This one explains how to connect to SQL Server: http://office.microsoft.com/en-us/access-help/import-or-link-access-to-sql-server-data-HA010341762.aspx
This one covers all sorts of forms: http://office.microsoft.com/en-us/access-help/CH010369205.aspx
Go there, you will find a lot that can help you with whatever you are going to do.

Make sure you have the SQL Client driver installed on the workstation where you'll be using MS Access. You can download it here (look for sqlcnli).
The simplest way to get started is to build an ODBC DSN. Access can then link to your SQL Server tables using that DSN. How to Create a DSN
In Access, Go to the "External Data" option and choose ODBC. Locate your DSN and then select which tables you want Access to be linked to.
After your linked tables are showing up in the tables list, click on one of the tables, go to the Create tab (2007, not sure about 2010) and choose Form. This should automatically create a form for you using the table you had selected when you clicked the Form button. There's no need to write code or add buttons to this form. The default form can do all CRUD operations as long as permissions for all CRUD have been granted to the username you used when you created your DSN.
Some developers prefer to use ADO (code only, no linked tables or form wizards) or Pass Through Queries to access SQL Server from Access. I can't really tell you what you should be using because it depends on so many different factors including (but not limited to) size of project, amount of records, skill level, personal preferences, etc.

Related

How do I make a vb.net project in visual studio that uses a sql server database, but make that database available offline when users are off site?

I have a program that helps salesmen design and price products. The pricing information for the program is held on the server in a SQL database and accessed with a dataset as normal.
My program will therefore run if the user is connected to the network, but when the salesmen go off site (as salesmen are prone to do) they lose access to the database.
The server instance is professional, but the salesmen will only get an express edition. While I can use push replication to send the information from the server to my laptop in SQL Server Management Studio, I have no idea how to make this work across everyone's installations from visual studio.
I'd appreciate any links to articles I should read to learn more as well as any direct solutions.
Many thanks!
Do you only need this princing information (you're writing 'bout one dataset) then one way would be to just save this Dataset (or 2-3 datasets) as XML on the salesmens Laptop. If you have no connection, you read the XML and inform the user, that he's working offline.
Now this only works, if you do not need to write back the data and there are not thousands of records.

Disable Access To SQL Server Database Via SQL Server Management Studio

Apologies in advance for the long post, I am trying to be as clear as possible. Is there a way to disable a user / Windows AD group accessing a database via SQL Server Management Studio (SSMS)?
I have an desktop application that uses a SQL Server 2005 database. The application runs as the user logged onto the machine (unfortunately we can't change that otherwise this would be simple). The database is permissioned with groups (but it would apply to users as well) to give access to the appropriate schemas and objects that the user requires. The users have (and need) the ability to select, insert, update and delete data to complete their process.
The application carries out a series of validation and auditing steps on the user input to ensure they are entering decent data (and for some additional business processing). A user could open SSMS and make these changes through the query editor avoiding the application completely which is what we are trying to avoid. What I am looking for is a way to stop the users updating the database through any tool other than the application provided.
I have found a couple of similar posts (including How to disable SQL Server Management Studio for a user) but these don't quite cover this issue as they work on restricting user access or using different logins.
The only solution I can think of at the moment is to have a set of tables where the user data goes initially and then another process picks this up, runs the application processes on and then puts the data into the master / source tables. Then I could restrict user access to the master tables.
This appears to be a good scenario for an application role.

Strategies for distributing SQL-server-based application

I have written an application in vb.net, based on SSCE. Now I need to shift in SQL Server Express because I need to run the application on Sharing (LAN) and several users need to access the database at the same time.
I am absolutely new to SQL Server. I need to know the following:
1) Do I create SQL Server DB by Adding New Item in my VS 2008? or they need to be created in SQL Server mgmt Express ONLY?
2) How do I distribute these database, same way like SSCE databses?
3) Can these databases be used like we use Access DBs in sharing (just put in the shared folder)?
4) If no to Question 3, how to set the connection string as I donot know the name of computer of the user who will install my application.
Thanks
To create a new database, the easiest thing would probably be to do
into SQL Server Management studio, open the instance of SQL Server
where the database will live, right click on the "Databases" folder
and select "New Database...". Once the database is there you can add tables and the like.
You will not distribute this database. Instead you will include a
connection string in your application that references this DB. All
data will live on a single instance.
No, you will not share this like you shared an Access Database. One
problem I have with Access is that the untrained masses are set
loose on the database to do as they please. I would give as few
people as possible access to the database. And when you give them access limit their permissions to the bare minimum they need. If you want someone to
change the data in there create an application that allows them to
modify table records as you see fit.
Take a look at this link for an explanation of how you should setup
your connection string. The connection string itself will not vary
between machines. You will just need to use the appropriate account
that has the appropriate access to the DB. You will also need to
make sure that the server where the DB is running is accessible.
Good luck!

is there a simple front for sql server?

i am in a multi-user environment
i am using access as a front end connecting to sql server database. i am allowing users to edit only one table in sql server.
i dont want to continue using access to edit a sql-server table.
can someone recommend another tool to do this?
The Access 2007 runtime and the Access 2010 runtime is free for the download from Microsofts website. Of course you'd want to purchase Access licenses for power users who want to create their own queries usually for export to Excel.
Either Access or Excel are almost certainly the simplest solutions available that meet your requirements, when you consider both the simplicity of the user interface itself and the simplicity of implementing, deploying, and maintaining the solution for the users. Creating even a simple web page isn't nearly so simple – you'll need to setup a web server, configure user security, develop the web page, etc.
Use SSMS -- Sql Server Management Studio.
Update
Found a near duplicate #SU: Less daunting front end for SQL Server
Update 2
Try to use Microsoft ASP.NET Dynamic Data. And a tutorial on YouTube, of course.
Sounds like you need to give CRUD access to a table in a SQL Server database.
Suggest making a simple page - use ASP.NET Dynamic Data. Watch this video to get started with ASP.NET Dynamic Data.
Failing that, provision the user with Microsoft Access.
setup a new user in SQL Server, and give it permissions on that table only.
setup Access to read, update, create and delete that table. Use the credentials of the user in the bullet above. This will ensure they can't mess anything else up.
Only bring that table into the user's view.
If you pull down a copy of visual studio express you could build a single screen application that allows editing a table with just drag and drop from the server explorer. No coding needed unless you're looking to add some more advanced logic.
Alternatively you could just use Access to also build a one screen front end - with that as the start up form to your Access DB your users wouldn't even know they're in Access.
Edit:
Assuming you're in a windows domain - put all your users in to a security group and then grant this group access to the SQL Server. Only grant the group permissions on the specific objects that they need to edit.
Create a blank Access DB.
Link your SQL Server table in to the Access DB - e.g. in 2007 the option is in the External Data ribbon > more... > ODBC database.
Once you have the table linked create a form to edit the data by doing Create > more > Form Wizard.
This allows you to pick the exact columns you want them to edit, pick a layout etc.
From here the options are really only limited by how much effort you want to put in but it's a good start in contrast to direct table access.
I believe it's still in Beta but you might want to also take a look at WebMatrix.

Change Access link from SQL Server to another Access file?

I've seen lots of questions regarding moving data from Access to SQL Server, but I'd like to go the other route. Here's why:
I've been working on a sizable project with a SQL Server 2008 back-end and Access 2007 front-end. I'd like to be able to do some work on the front-end from home over the weekend, but I don't have access (VPN or otherwise) to SQL Server from there. I'd like to change my linked tables from SQL Server to another Access database file where I imported a snapshot of the SQL Server data. Then, come Monday morning, switch links back to SQL Server.
My problem is when I go to the Linked Table Manager and attempt to change the link, all I get is the ODBC Select Data Source dialog. If I try to link to an Access database, it tells me ODBC can't be used to link, import or export to another Access file.
One thought has occurred to me but I haven't tried yet; maybe someone could tell me if it's a good or bad idea: would I be able to delete the links, re-create them to the other Access file, and not lose any functionality in my queries/forms/reports?
My proposal would be to have SQLExpress (free) installed on your computer. You can then have all the data available on the machine. Create a publication on your main server, and have your local machine suscribe to this replication (if you don't need to save/synchronize the data changes done on your machine, you can stick to a basic 'snapshot' replication.)
You then just have to change your connection string from your network MSSQLSERVER to your localhost SQLEXPRESS server instance to have your app work.
If, for any reasons, you have to make changes to the database model while being off-line, you will then have to unsubscribe from the main server before making the changes on the local server. When you're back to the office, make sure that the same changes are done on the main server. My advice is to write your changes in T-SQL, save them in a file, and launch the file against the main server once you're back to work.
My opinion: don't work too much on weekends, or make sure your client is being billed for that.
For linking tables, you need to delete them and entirely and recreate them. Using the linked table manager to refresh ODBC links doesn't even work reliably when you're still using ODBC, as there is data cached in the table link definitions that doesn't get refreshed (e.g., if you change the number of columns in a SQL Server view, refreshing the table link with Linked Table Manager will update the number of columns, but you won't necessarily get an updateable view (assuming the original was updateable)).
But it's not clear whether or not you'll lose functionality or not. That all depends on how much of your application's logic is server-side, in SQL Server views and stored procedures. None of those will work if you link to a Jet back end.

Resources