ms-access

Query input must contain at least one table or query

I'm really hoping that somebody could help me regarding this problem. I am using Microsoft Access 2007 to build some forms while connecting to my sql database. Everything seems ok except the forms inserting data in the database showing this kind of message "Query input must contain at least one table or query" I'm not finding where the...

Make a query Count() return 0 instead of empty

I have a report that tracks how long certain items have been in the database, and does so by tracking it over a series of age ranges (20-44, 45-60, 61-90, 91-180, 180+). I have the following query as the data source of the report: SELECT DISTINCT Source.ItemName, Count(SELECT Source.DateAdded FROM Source WHERE Int(Date()-Source.DateAd...

How Do I Copy a table from one Access DB to another Access DB

I am trying to automate a process to create a secondary database from a primary. Both DB's (MS Access) contain one table; the table in the secondary DB is a subset of the table in the primary. Is there a simple way to copy a recordset frone one DB to another? I am using VBScript and ADO. Thanks! ...

MS Access 2003 - Importing a Text File into MS Access Database Table

At work we have this reporting tool. It is distributed to everyone as a MDE tool that is locked up pretty good (VBA is unviewable, cannot import any of the table, query, forms, etc). When each person fills out their applicable portion there is a button that conslidates it into a text file, and then sends it to Outlook. Then everyone emai...

Record locking in vba

i have a VBA application which is spitted into two one for front end; and backend while updating how to prevent two users edit it ?? ...

SQL code to insert multiple rows in ms-access table

I'm trying to speed up my code and the bottleneck seems to be the individual insert statements to a Jet MDB from outside Access via ODBC. I need to insert 100 rows at a time and have to repeat that many times. It is possible to insert multiple rows in a table with SQL code? Here is some stuff that I tried but neither of them worked. Any...

ColdFusion 8 connect to remote access MDB

I have an Access MDB file on a different server than my ColdFusion server, is there any way I can get ColdFusion 8 to be able to connect to it over the network? ...

how to connect to multiple access databases at one time

Can someone please tell me how I can connect two databases at once? I need to get two sets of data for a conversion we are doing. db1 and db2 are the names. I thought I would do: select * from db1.table1 as table1 inner join db2.table2 as table2 on table2.column = table1.table1.column Any help would be great. Thanks ...

What's wrong with these parameters?

I have an Access file with 7 fields: DocID - text - primary SourceID - text ReceivedDay - Date/Time Summary - text DueDay - Date/Time Person - text Status - Yes/No Now I want to update this file with the following code: const string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\DocMan.mdb;Persist ...

How do I join 4+ tables in Access with a combination inner/outer?

I have not been able to find a way to join 4 or more tables using outer join in MSAccess. It works in SQL Server, but not Access. I don't believe it is possible. I have tables A, B, C, D and E. I need to join the tables like so: A left outer join B A left outer join C A inner join D B inner join E Access won't let you use conventiona...

SQL (access) - add a new field to a composite primary key

I have a table called table1 which has a composite primary key using 'ScreenId' and 'ActivityItemId'. I have added a new field 'ProductId' which has a NOT NULL constraint. I want to add ProductId to the composite primary key. I thought that this would work db.execute "ALTER TABLE table1 PRIMARY KEY (ScreenId, ActivityItemId, Produc...

How to display a non matching value also?

USING VB6 AND MS-ACCESS 2003 So on…, TABLE 1 EMPID DATE 101 22-07-2009 201 22-07-2009 501 22-07-2009 301 23-07-2009 401 23-07-2009 501 23-07-2009 101 24-07-2009 501 24-07-2009 So on…, From the above table two tables I want to display all EMP ids for the date wise Expected Output EMPID DATE 101 22-07-2009 201 22-07-200...

MS-Access - how to find the name of the composite primary key and associated fields

Hey all I have a bunch of Access databases, each of which has several tables. Each table has a composite primary key, with varying fields comprising that key. How can I, for a given table, get the name of the primary key and the names of the fields which are used in it? I.e., what's the SQL to do that? (I need to use raw SQL rather tha...

Maximum number of rows in an MS Access database engine table?

We know the MS Access database engine is 'throttled' to allow a maximum file size of 2GB (or perhaps internally wired to be limited to fewer than some power of 2 of 4KB data pages). But what does this mean in practical terms? To help me measure this, can you tell me the maximum number of rows that can be inserted into a MS Access databa...

Access VBA How to add new sheets to excel?

Hi, I am running a few modules of code in access and am writing data into Excel. When I write the first time, data gets written properly. But again when I try, the new data is written on top of the old data. What should I do to insert a new sheet? My existing code is Dim objexcel As Excel.Application Dim wbexcel As Excel.Workbook D...

Programatically rename tables in Access queries

I have an access 2003 database file with hundreds of queries. I would like to rename all tables referenced from within my queries based on a condition If tableNameInQuery = "tableName" Then tableNameInQuery = "newTableName" End If Any suggestions or articles would be great. Thanks PS an example in either C# or VB.NET would be ...

VBA error with modules: 'can't find the module'

...

MS Access 03 - Query Expression to Add like ID Numbers

So I have a query that is a Top Nth aggregate query, and I have another query built from that one that returns all the offices/locations grouped for each of the top sales. I want to make a report that counts the number of offices associated with each of these top Nth ID values that are returned in this query. I want to use a domain aggre...

Calendar Control 12.0 Refuses Input

In Microsoft Access, I have a series of forms that require the user to specify a date range. Right now I do this with Calendar Control 12.0. However, at random times, the control refuses to accept any user input (such as changing the date). Why would the Calendar Control refuse input? Is there any known workaround for this? I'm runn...

Connect to an access database in a remote directory using dao (VB6)

I need to replace this structure: dim base as dao.database set base = opendatabase ("c:\path\name.mdb") with another in which the .mdb is located in a server directory. I tried: dim base as dao.database set base = opendatabase ("\\server\folder\name.mdb") but it did not work. I'm using VB6. Any ideas? ...