ms-access

How to control user rights to an Access database?

What is the simplest way to allow one user write access and everyone else read-only access to a MS Access database on a local network? I trust my users, but unfortunately Access saves changes to data as soon as the row of a table is deselected. Accidental keystrokes are saved without the user asking for the changes to be saved. ...

"Distinct" results from SQL query using a mappings table

Hi, I have two tables tbl1 and tbl2, both with two columns, one for id and one for product. I want to extract the rows that are in both, i.e. rows where tbl1.id = tbl2.id and tbl1.product = tbl2.product and join the row from tbl1 and tbl2 into one row. I imagine this goes something like this: SELECT tbl1.\*, tbl2.\* FROM tbl1, tbl2 WH...

Ms-Access Query is getting deleted automatically. What can be the reason?

Some of the queries I have written inside MS-Access are getting deleted automatically. And while I run the queries through code, I get this error 'Query should have one destination field' What can be the possible reason Explanation: I created a query in MS-access. Ran it from the code. Closed the database. Started it again, and now fo...

Using "IN" in a WHERE clause where the number of items in the set is very large

I have a situation where I need to do an update on a very large set of rows that I can only identify by their ID (since the target records are selected by the user and have nothing in common other than it's the set of records the user wanted to modify). The same property is being updated on all these records so I would I like to make a ...

Calling managed code from Access 2003

I have cross posted on access-programmers.co.uk Please post responses on that forum is possible.. I have compiled a dll in c# 3.5.. where I set the solution properties to register the build for COM interop. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; name...

C# Cannot save data in Access 2007

I cannot save data in access 2007. I tried the following: Add a password to my DB; didn't work Saved the db as a 2003 file; didn't work Here is my code: public bool ExecuteUDI(string query) { Command = new OleDbCommand(); Command.Connection = Connection; Command.CommandText = query; Command.CommandType = System.Data....

Preserving linked tables for Access DBs in same folder when the folder changes

I've got two Access databases that share linked tables. They are deployed together in a directory and accessed via code in a Word form. How can I make sure that the links are preserved when the two databases are copied (together) to a different folder? Since I'm not "opening" the database, per se (it's being accessed via ADO), I don't k...

SQL Update woes in MS Access - Operation must use an updateable query

I have a select query which does some text manipulation to essentially reformat a field so that I can look it up in another table: If my first table if I have a field like "J1/2" it looks up the ID of a record in a different table with J1 and J2 in the appropriate fields. This all works well. Now I want to update the original table so...

Why does createProcessingInstruction in VBA generate incomplete output?

The following VBA code generates <?xml version="1.0"?> as output. Dim XML As New DomDocument Dim pi As IXMLDOMProcessingInstruction '.... some code that sets the root element of the document Set pi = XML.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'") XML.insertBefore pi, XML.documentElement Why is the ...

ShellExecute() returns error code 5 when trying to open mdb file >10MB

I have an MsAccess 2003 application which is a dashboard to launching other MsAccess apps. I employ the API ShellExecute to launch/open the MsAccess app as below: lngReturn = ShellExecute(Application.hWndAccessApp, _ "Open", _ AccessMDBName, _ "", _ ...

Parsing a web form in to a data table

Hi to all, has anyone an idea of how to write a dynamic data parser in VBA to capture data from a text file and input it in to a database table (ms access)? The form has about 55 fields, so I'd rather write a code that is capable of picking up the field name from the text than copying a load of text. Is there a smart way to do this and a...

Access/VBA: Prevent moving to next record when hitting Enter?

I have a form in Access 2003 that should only be working with a single record. I can set the Cycle property to Current Record, but the form still jumps to the next record when I press Enter. My first thought was a KeyPreview property, but I'm not seeing one. My other thought is maybe the KeyPress or KeyUp event, but I thought I'd ask ...

Separating data from a constantly appended file into a new file

I am using a macro to export a table in a Microsoft Access database to a csv file in order to import into a mysql database. I ended up using a batchfile that would place a marker in the text file before the exporting took place, and then place everything after the last marker into a new file. This works fine, except for the fact that acc...

Convincing an IT Manager to allow SQL Server instead of Access

An IT Manager is not allowing the use of SQL Server with an ASP.NET website being developed. The current setup being replaced is a php site connecting to a Microsoft Access database. I have a few reasons of my own as to why SQL should be used, but would like as many strong arguments as possible (student vs. IT Man.). Does anyone have a...

Weird Bug: "DoCmd.OutputTo acOutputQuery" is deleting the query

Has anybody encountered this problem that DoCmd.OutputTo acOutputQuery deletes the query itself, the second time it is run? Is there any workaround/patch for this bug (at least seems like a bug to me)? Is there a better way to do this? ...

How to use the SQL replace function effectively?

I am trying to replace multiple rows in an Access database to follow a new set of data rules. For instance, the word Fort in Fort Myers is listed as Ft., Ft and Fort. I would like to make a global change to the group. I am familiar with the SQL replace command, but wondering if anyone has done something similar with a stored procedure...

Convert rows to columns

What is the best way to do this in Access? Create table tmp ( plant int, material vchar(20), workcenter int, setuptime vchar(20) ) insert into tmp values( 1, mat1, 2, 30) insert into tmp values( 1, mat1, 3, 30) insert into tmp values( 1, mat2, 3, 30) insert into tmp values( 1, mat2, 4, 30) insert into tmp values( 2, mat1, 4, 30...

Alternative to MS-Access/Excel for Spreadsheet Manipulation

I have an MS-Access application that formats the data in two large spreadsheets (20,000+ rows), imports this data into tables, runs a few queries comparing the data and outputs the results as excel files. The problem is that as the application (and VBA code) grows it's becoming more of a pain using Access and I'm wondering if there is ...

php sql using odbc

Hi Im making a website in php with a microsoft access database through odbc and i have come across a small problem let me show you my codes first. <form method ="POST" action="maxtimestamplog.php"> Longitude <input type="text" name="longitude" /><br/> Latitude <input type ="text" name = "latitude"/> <input name="ok" type="submit" val...

Issues with Combo boxes

I have a database that I've converted over to 2007 Access. I ended up rebuilding the Combo boxes. They all work fine in the active databae however as soon as I close the database and reopen it - they don't work and a number of errors are displayed.. If I create a second combo the same way -Then both combos start working... but once ag...