ms-access

MS Access Query "WHERE" Exception

I am writing an application in C# that reads info from a .mdb file using the System.Data.OleDb namespace. The table I am reading from contains information about a sample (number, index, date, etc). The number and date are required entries when a new item is added to the table, but the index is optional, so some samples do not have an ind...

Data update error with SharePoint 2010 and MS Access 2010

I've encountered a strange error when attempting to update a SharePoint 2010 list that I have linked to via Microsoft Access 2010. Error: Data cannot be inserted because there is no matching record. This occurs in 2 scenarios: I attempt to run any UPDATE query against the list in MS Access I attempt to update a record from the list...

Get Name of Current VBA Function

For error handling code, I would like to get the name of the current VBA function (or sub) that the error occurred in. Does anyone know how this could be done? [EDIT] Thanks all, I had hoped that an undocumented trick existed to self-determine the function, but that obviously doesn't exist. Guess I'll stay with my current code: Option ...

Permissions error when opening file in Access

I have access file and when i try to open i got this error: You do not have the necessary permissions for this object XX... Ask the administrator or user who created this object to create the appropriate permissions for you is there any way to open it ? or any tool for this ? thank's in advance ...

How can I get notified in C# WinForms of external MS Access database updates?

I have a DataGridView that displays data from a MS Access database. I'm using a DataSet with a TableAdapter and a BindingSource to link the data to the DataGridView: tableAdapter = new AccountsTableAdapter(); dataTable = new Accounts.AccountsDataTable(); tableAdapter.Fill(dataTable); tableBindingSource ...

Ms Access frontend, PostgreSQL backend efficient INSERT INTO ... RETURNING ... statement

HI, I'm using MS Access as a frontend to PostgreSQL database. And I have run into dead end: How would I get return value of passthrough SQL INSERT statement? I tried something like this: strSQL = "INSERT INTO someTable (col1, col2) VALUES ('val1', 'val2') RETURNING col0" 'Create passtrhough query dynamically (another function) Create...

Custom Record Navigation

Hi I have an App with nested sub-forms, the record navigation is confusing and I've started moving the Record Navigation controls to the top of the forms to improve that. I'm stuck on the 'n of n' field, is there a generic property(s)/query that will give me this? ...

Show Report Pages Count Only On Print

In MS Access reports, page counts can be displayed using a text box with the following: = "Page " & Page & " of " & Pages & " Pages" However, this is problematic for large reports, as Access cannot open the first page of the report in Preview until ALL pages have been formatted (so it knows the total number of pages). Ideally, in Pre...

Circular References in Database Design - Should they be avoided?

Hello guys, I am currently developing a database via MS Access 2003 and got stuck at a circular reference problem. Basically, it comes down to the following relationship triangle (it is a simplified form of my relationship table): Positions oo oo / \ ...

Converting an Access crosstab query to SQL Server 2005

Hi, I am attempting to convert an access cross tab query to SQL, and am hoping someone here can help me in the process. The access query is: TRANSFORM First(tbl_Proj_Budget.BUGDET_LINE_BURDENED_COST) AS FirstOfBUGDET_LINE_BURDENED_COST SELECT tbl_Proj_Budget.PROJ_ID, First(tbl_Proj_Budget.BUSDET_LINE_BURDENED_COST) AS [Total Of BUGDE...

how to use a composite key with the IN keyword in MS Access

I want to write the following (pseudo) SQL statement in MS Access: Select C from MyTable where (A, B) IN (select distinct A,B from MyTable); I tried that but got the complaint "You have written a subquery that can return more than one field without using the EXISTS reserved word in the main query's FROM clause." I appreciate any fee...

Save Excel 2003 worksheet into an Access 2003 table

I'm trying to write a macro to export a single row from a single worksheet from an Excel 2003 workbook to a new row in an Access 2003 table. I'm new to VBA, and everything I've found on the web refers to going the other way -- from Access to Excel. I want this to be an export, not a link, and I don't care about keeping them synced afte...

SQL Query to show 3 user names from userID's in one Bug record.

I would like to show all the usernames who have interacted with a bug in MS Access. I do not understand how to reference the same Users.UserName field 3 times in my select statement? Here are my tables -------------------------------------------- Table 'Bugs' -------------------------------------------- BugID OpendBy ClosedBy ...

Exception using DateTime in a parameterized OleDbCommand

I'm trying to insert a System.DateTime into an Access database using a parameterized OleDbCommand in C#. However, it throws a Data type mismatch in criteria expression exception. Here is my code: string statement = "INSERT INTO Log (SCTID, LogDateTime, Type, Message, Visible)" + "VALUES (?, ?, ?, ?, ?);"; OleDbCommand insertComman...

Access 2003: How combine two count queries

I am writing my first little Access 2003 application. I have two queries that I cannot figure out how to combine. What I am looking for is to get all the routes numbers in a date range, count the total rows per route in the date range, and count how many were late. I have these two queries that get me part of the way there, just can't ...

writing to MS-Access DB Issue in C sharp

Hey guys, I'm just doin' practise Program to read,write data to Access DB in C# and i'm having a problem in writing data to Access DB though i'm able to read data i.e fetchin' is working fine but when i insert data my "ExecuteNonQuery" is working fine i mean without ne error but when open the Access DB the data is not there.... here is t...

Multiple conditional counts on one field in SQL

I have two tables where one contains author deatils and the other article details. One author may have many articles. In the article table is a field entitled "Decision" The decision field can be "Accepted" or "Rejected". I want a query to output a table of author name and ID followed by a count of their number of submissions, accepts a...

RIGHT function, not returning whats expected?

Query: SELECT StartDate, EndDate, RIGHT(Sector, 1 ) FROM Table1 ORDER BY Right(Sector, 1), StartDate By looking at this, the query should order everything by sector, followed by the start date. This query has worked for quiet awhile until yesterday where it did not order it properly, for some reason, Sector 2 came before Sector 1. Th...

Determine whether a Access checkbox is checked or not

Such a simple question, but I cannot find the answer (Google, MS help, SO): How can I check by VBA whether an unbound checkbox @ a Access form is checked by the user or not? Can't find the right property. Thanks in advance. UPDATE: I use this code after the suggestions of @HansUp and @RC: Private Sub CmdTest_Click() MsgBox "Check1...

MS Access - Adding unbound fields at design time

I would like to create an Access report in which the record source is created via ADO code and then set as the record source for the report when the report is run. The problem I am running into is how to add fields to the report since the recordset is bound to the report at run-time and not design time. Is there way I can manually add t...