I am new to VSTO, and am developing an addon to Outlook that will allow the end users to track relationships between contacts. The relationships are stored in a separate SQL database, and I put the ID of the SQL data row in a custom property attached to the Outlook contact. Unfortunately, if the user ever views the "All Fields" pane, this ID is visible under "User-defined fields for this item". Is there any way to prevent the user from being able to see (and more importantly edit) these properties?
I don't believe there's any way to "attach" data to OL contacts that can't be seen by the user.
On the other hand, you could have a field in you DB that tracks the Contact ID (I forget the exact field name offhand, but I know each contact has a unique key value associated with it) and then use THAT when getting to the data in your SQL DB.
The only problem with that approach is that outlook has a habit of resetting that PK value when you do certain things (like move a contact from one folder to another, Outlook treats that as a DELETE/ADD, so the PK for the contact will change).
I seem to recall using a hybrid approach at one point that did BOTH (stored the PK of the contact in SQL and a custom field in the Contact stored a SQL ID) and then just keeping them synched. But as I recall, it was a bit of a pain.
alternately, if the user moved a contact, YOU could also treat it as a DELETE/ADD and update your SQL as applicable.
Related
My data is being taken from Excel Tables and a messy Access Database.
I have cleaned up the data using PowerQuery in Excel. As such the information going into the creation of a new functional database in Access 2016. Currently have ID numbers linking the various tables together already in excel and I would like these linkages to carry over to excel to help with the design of queries and forms to ensure their functionality.
What I need is a method to add autonumbers/ID numbers to the various tables AFTER the initial data is uploaded.
Therefore the numbers need to continue from last number in each associated table, when new information is added.
Is there a way to set the database to do this to automatically?
I tried to set the ID field to AutoNumber, but it overwrites the original ID numbers which means none of the tables will properly link to each other.
I have tried to set the field to autonumber AFTER adding the information, but the system won't allow that.
I am assuming I will be stuck using VBA and forms to do this, but I honestly don't know how. It seems that no one has ever asked this question before as my google search keeps coming up empty.
Please note, management wants an Access Database, so no I cannot keep it in Excel.
Thanks for any help you can provide.
I'm using this forced "down time" to finally take my business from Excel to Access. I am fairly accomplished at Excel VBA etc, and pretty much run the business on a handful of highly developed Excel sheets I’ve created over the years. They work well, but they are not very scalable, and I want to get over to a proper relational DB.
I've taken an Udemy course on Access which was fine, but I’ve already hit some issues which may be fundamental misunderstandings, or just inexperience.
My first issue is that my company has projects (commercial contracts) which often, but not always, involve two ‘customers’ - an End User and an Agent. Agents and End Users can be interchangeable though, i.e. an Agent on one project might be the End User on another, so my “Customer Table” is simply a list of ALL my end users and agents with a CustomerID.
In my “Project Table” I have a CustomerID field and an AgentID field, both of which I wanted to use to pull out a customer and then agent from the single “Customer Table”. I can’t find the way to set up the relationships to enable me to do that – I can get either one, but not both for each Project Table query.
For a while I thought I needed a many-to-many relationship I needed, but I still don’t find how I can reference two entries from a single table in one record.
Thanks for any help!
You're almost there. What you need to do is to create a one-to-many join between tblCustomer and tblProject (based on tblCustomer!CustomerID=tblProject!CustomerID) and then another one-to-many join between tblProject and another instance of tblCustomer (based on tblCustomer!CustomerID=tblProject!AgentID). The relationship window should look like:
Regards,
I'll summarize the operation to give you a background.
I've an Access database in place with forms wherein a user inputs with diverse fields. This file is hosted on a shared network for my organization. The database is split between backend and frontend.
Issue(s):
- Multiple user cannot access a single form and simultaneous entries are not allowed.
- In case, if the file is opened by mistake it will prevent to enable submissions for other users on the network.
I am not sure if this will work as I am a newbie in Access. But can we create a HTML based form which will fill the tables in Access? If yes, kindly help in creating one. If not, kindly suggest an alternative.
Sample table attributes:
Date Name Type Remark
This is the same type of setup I use at my company. We have one backend (all the tables) and a frontend (queries, forms, reports, etc). The way to allow multiple users to work with the database is to have each user run their own instance on their computer ie have them copy/paste the frontend to their local desktop. Another thing to keep in mind is that the tables must be set up with primary key and autonumber field to prevent users from accessing and editing the same record.
I'm writing an application that reads data from a relational database, let's the user change the data, and writes it back.
I am unsure how to deal with the primary keys since I do not want to show them in the user interface output. What are good practices to hold the primary keys invisible for the user but so that they can easily be retrieved after the changes in the gui are made?
I use C#, Windows Forms and sqlite, if needed.
EDIT: Example: I have a text input that contains the wage of a employee. Can I save the the primary key of that employee bound to that text input, so that changes made by the user can be written back easily?
If you're using an ORM you have the PK as a property of the object. If you're using SQL queries directly you can hold PK in an internal variable in your form class.
I want to build an online form builder much like wufoo that allows the users to create and publish their own web forms. Each submission should be saved to a data base where the user can later retrieve the submissions.
As these forms will be dynamic, ie. the user has complete control over the amount and type of form fields I am trying to think of a solid database design to store this information.
I would have one table fieldtype which contains every type of field available to the users, ie. textfield, emailfield etc.
One baseform table which will hold each forms id, url etc.
I would then have a table formfields which would contain ref to the baseform and to fieldtype, this table could also include custom validation to be done on each field.
Is this design good as a base structure? I imagine it will be easy to add new types of fields to the application however I don't know what the potential downsides are as I am far from a sql expert.
store user defined data in SQL
I think you are looking for the Entity–attribute–value database model in which:
The basic idea is to store attributes, and their corresponding values,
as rows in a single table.
Typically the table has at least three columns: entity, attribute, and
value. Though if there is only a single relevant entity, e.g. a table
for application configuration or option settings, the entity column
can be excluded.
See this pages as a start:
Using Database Metadata and its Semantics to Generate Automatic and Dynamic Web Entry Forms (pdf)
Planning and Implementing a Metadata-Driven Digital Repository (pdf)
I retagged your question with entity-attribute-value tag, in which you can browse a lot of threads that relate to your case.
As Mahmoud Gamal writes, The model you describe is "Entity/Attribute/Value"; as Borys writes, there are many known problems with this model.
As an alternative, you might consider storing the form entries in a "document" - e.g. XML or JSON - within a relational model.
For instance, you might have a table along the lines of:
FORM_SUBMISSION
--------------------
Submission_ID (pk)
Client_ID (fk to clients table)
Submission_date
SubmissionDocument
I'm using "client" to represent the users who create the form; to retrieve all submissions for a given client, you use a where clause on client_id.
This model makes it harder to run SQL queries against the form submission (though that becomes hard with EAV too when going beyond very simple queries), but it dramatically simplifies the persistence solution.