ms-access

Selecting records from the past three months

Hi Everyone, I have 2 tables from which i need to run a query to display number of views a user had in the last 3 months from now. So far I have come up with: all the field types are correct. SELECT dbo_LU_USER.USERNAME , Count(*) AS No_of_Sessions FROM dbo_SDB_SESSION INNER JOIN dbo_LU_USER ON dbo_SDB_SESSION.FK_USERID =...

Show only Previous Month's data in SQL

I have been told to create a query that will show the top 10 most used applications in our company, and on the 11th row should group all other rows into it and call the record "Other" and sum all the sessions together. How do I modify this code to only show monthly records? Code Snippet SELECT TOP 10 dbo_LU_APPNAME.APPNAME, Count(*) ...

Error returning object instance from function in VBA

I'm trying to instantiate an object and return it from a function. The class I'm working with is one that I've created. However when I try to set an Object to what was returned from the function I get an error. What am I doing wrong? Function CreateBlah(NAME As String, Count As Integer, val As String) As Blah Dim b As Blah Set b...

How do I correctly use "Not Equal" in MS Access?

Objective: The intent of this query is to select all of the distinct values in one column that don't exist in a similar column in a different table. Current Query: SELECT DISTINCT Table1.Column1 FROM Table2, Table1 WHERE Table1.Column1 <> Table2.Column1 Results From Query: What happens when I try to run this query is the progress ...

sql to calculate daily totals minues the previous day's totals

I have a table that has a date, item, and quantity. I need a sql query to return the totals per day, but the total is the quantity minus the previous day totals. The quantity accumulates as the month goes on. So the 1st could have 5 the 2nd have 12 and the 3rd has 20. So the 1st adds 5 2nd adds 7 to make 12 3rd adds 8 to make 20. I'v...

SQL query with regex in ms-access database

Hi, I'm working with C# .Net and ms-access database. I have the following SQL query: `Select ... Like "%<aaa>%"+prmPhrase+"%</aaa>%"` The query is looking for a phrase inside a database field which contains xml data. the query works very quickly, but it returns a lot of false results. I can't search only the exact phrase becau...

MSAccess - Design query to group by anniversary date.

Hi, Lets say I have a table with these fields LeaveDate LeaveType I want to write a query that groups by an annivesary date. For example say 8th Feb. So for this year any dates after 8 Feb would be "2010" and any dates before 8 Feb would show "2009". I want this to occur for all years data. Understand?? Malcolm ...

MS Access ADP Disconnected Recordset Reverts

I have an Microsoft Access 2003 ADP, which uses a bound "main" form with several bound continuous-style subforms. They all utilize disconnected Recordsets via a helper class. Several users have noticed the same strange behavior: they add/edit a record in the continuous subform, they leave the record (committing the edit to the Recordse...

unknown data in access

Hello all. I have a problem in access. I have an access db with some tables, and I cant read the data stored in that and the characters are some squares. I tried many fonts but I can't read it yet. can anybody help me? ...

Compact Access 2007 DataBase File In C#

Hi all I want Compact a Access DataBase File in C# by Code. please Help me Edited: I USe Microsoft Access 2007 DataBase File ...

Get all field names in Microsoft Access Table using SQL

Hello all, How do I get all the field names in a Table in Microsoft Access using JET SQL? Thanks all ...

How can I convert a program currently using an Access database to use Microsoft SQL Server?

I have a Windows application written in C# that works with an Access database file. Furthermore, I use some DataSets in my project that work with this Access database. Arising from this, I have two questions: How can I convert the Access database file into an SQL Server database, and How can I convert the project code (using Access Da...

Connecting to MS Access 2007 using ODBC_CONNECT - error in driver?

Hello all, I have been successful in querying a Microsoft Access 2003 database (.mdb file) and now I am trying to do the same for a Microsft Access 2007. I have tried the following: if($type[1]=='accdb'){ echo 'accdb'; //2007 Microsoft Access $connection = odbc_connect("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$mdbFil...

Compatible and recommended data types for MS Access frontend / MySQL backend

I need a list of recommended MySQL data types to use when using Microsoft Access as the front end. Can anyone point me to a succinct article on the net, or post a list here please? ...

Query to search tree in database

I have a table in my database representing a tree. The data is stored using nested sets. I want to write a query to search the tree and return just the nodes that match a pattern, along with their ancestors and descendants. This is what I have come up with so far. SELECT DISTINCT Node, Parent, Description FROM Hierarchy INNER JOIN ...

Access Project: Automatically Pass Parameters to Run Store Procedure Button

In an Access Project (ADP file ONLY) in Access 2007, how do I automatically pass parameters to a stored procedure when the stored procedure is called by clicking a button? The wizard allowed me to link a stored procedure to a button, but clicking the button prompts users for the parameters. I want to pass properties of the current reco...

Ruby win32ole MS Access: How to find all the records updated since last export?

Hello, I am using win32ole module/library to gain access to an Access database. But I can't find as I can in Rails the created_at or updated_at columns in any of the tables in the database. I was wondering how does one finds rows that are updated, then? So I have require 'win32ole' connection = WIN32OLE.new('ADODB.Conneciton') connecito...

What strategies are available for migrating Access databases to SQL server-based applications?

I'm considering undertaking a project to migrate a very large MS Access application to a new system based on SQL Server. The existing system is essentially an ERP application with a couple of dozen users, all sharing the Access database over the network. The database has around 300 tables and lots of messy VBA code. This system is beginn...

Defining Datatypes for Linked ODBC View Columns

In an Access app, I've linked to MySQL tables. I have also linked to a View. A couple of the View columns have been mapped by Access as Memo, and one as OLE Object. They should be Text(255). Is there anyway that I can fix this? MTIA ...

Checking if INSERT INTO statement was successful

I am using a MS Access database as the backend of my VB.NET application. I am entering users details into the database using an INSERT INTO statement: cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & config("DatabasePath") & ";") cn.Open() cmd = New OleDbCommand("INSERT INTO blah blah blah...", cn) dr = cmd.Ex...