ms-access

How to select a row based on a max count? (using standard sql)

I have a table: ComputerID, UserID, LoginDate I need a select statement that returns: ComputerID, UserID, LoginCount For all computers, but for each computer, showing just the one user that logged on most often to that computer. (If there is a tie, I guess I would want to just arbitrarily pick one of the users....so this would seem t...

How do I create a table alias in MySQL

I am migrating an MS Access application (which has linked tables to a MSSQL Server) to MySQL. As a means to overcome some MSAccess table naming problems, I am seeking a solution to add a MySQL table alias that will point to an existing table in the MySQL database. Ideally I would like to create the alias 'dbo_customers' in mysql that ...

Characters found after end of SQL statement VBA code Access 2007

I'm writing a vba code in Excel to access an Access database. I'm using this provider "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= " & DBFile & ";" and here is my SQL string SQlSrc = "SELECT YEAR FROM Data ORDER BY YEAR ASC" SQlSrc = SQlSrc & ";SELECT STN FROM STN_List WHERE include = TRUE" When I open each recordset individua...

Iterating through the Object Browser in VBA

I would like to iterate through members of any class in a referenced library much like is done using the Object Browser. How can this be done using VBA? ...

Creating an MS Access query based on system, status, and date

I am just learning Access and have been tasked with creating a database for system access. We need a report that shows what systems have been in a pending status for 0-30 days, 31-60 days, 61-90 days, and 91+ days. I am soooo close to getting this but I’m at a dead end. For the examples below I will just use NFC and eOPF as the system...

MS Access Typecasting Number to Double

I've got a MS Access 2007 DB with records of passed and failed attempts to pass an exam. Student_id, Course_id, passed S001 C001 0 S001 C001 1 S002 C001 1 S003 C001 0 'Passed' is used as a boolean where 0 is failed an 1 passed, but is stored as a number. I want to build a query dis...

.mdb - Access - database appending # on image file

I'm creating a website that interfaces with a .mdb database. I have a field that is using the data type "hyperlink" and pointing to a relative link for an image I want displayed. For some reason the link is appearing and not the image and there is a # that is being prepended and appended on each URL. I thought maybe the path was wrong ...

MS Access: searching a column for a star/asterisk

I'm looking for a way to search a column of string datatype which contains a * - the problem is that the star or asterisk is a reserved symbol. The following query doesn't work properly: select * from users where instr(pattern,"*") How can you write an Access query to search a column for an asterisk? ...

MS Access 2007 sql functions?

Does MS Access 2007 support creation of user defined sql functions? if so, where is the option for it in the menu? ...

Optimize SQL SELECT for 4000 searches, into Excel by VBA

How could this be optimized for speed by batching or other techniques? Its a 20MB Access2003 Database I am searching from Excel 2003 VBA. I have my Access Table Keyed (autonumber) so I though this would provide intelligent non-linear searching like binary searches. Currently searching for 4000 values from a table of 147k records is ta...

Events in MS Access 2007

I just migrated a database MS Access 2003 to MS Access 2007. But I have some problems with the events. When I opened the database (MS Access 2003) start form, I usually can click on the form and if I do double click on it, it will lead me to another form. Now after migrating to MS Access 2007, when I opened my database start form (MS ...

MS Access 2003 - Customized Auto-Number IDs for tables?

Is there a way to use my own number in a table like an auto-number; that is to automatically assign the next available to a new record. We have system ID numbers for each employee that I want to tie into this database. I just want the table to auto assign the next number. Can I do this? Could this be done with a mixture of numeric and a...

How do I implement pagination in SQL for MS Access?

I'm accessing a Microsoft Access 2002 database (MDB) using ASP.NET through the OdbcConnection class, which works quite well albeit very slowly. My question is about how to implement pagination in SQL for queries to this database, as I know I can implement the TOP clause as: SELECT TOP 15 * FROM table but I am unable to find a way to ...

MS Access 2003 - Listbox formatting control

Just some general formatting questions about return records to a list box on a form: I have a list box that returns sets of records based on SQL statement in VB. I need the SQl statement to return the ID (auto number) of each record, because if the user selects from this list box, I need the ID as a pass parameter to the next form. But ...

How do I add an email preview button to a form in MS-Access 2003

I'm creating a form on MS Access 2003 that will send out a html email newsletter to a list of email addresses. How do I put a preview button into my form that will let me preview my email before I send it? I think I have to use an active-x control, but I have no idea where to start. ...

VBA "delete" button in MS Access 2007

I'm trying to update the ribbons in MS Access 2007. I migrated a database from 2003 to 2007. In the ribbon I created it seems that the "delete" button doesn't work. I think one can adjust it in the VBA code, and I'm not sure what code I'll include. This is so far what I've got in my XML: <button idMso="Delete" label="Löschen" size="larg...

GetOpenFilename api call in Windows 7 won't allow direct access to My Documents

In many of my Access (2002) programs I use the GetOpenFileNameA and GetSaveFileNameA functions from comdlg32.dll. I often set the initial directory to the user's My Documents folder (using calls to SHGetSpecialFolderLocation and SHGetPathFromIDListA from shell32). This all works fine under Windows XP. However, I recently switched to W...

MS Access tables match and synchronize

Hi all, I have 2 computers each having a MS Access database, same set of tables with same structure. I want to match and synchronize both of those databases. I want to create some scheduled task which match all the tables in both databases, check for any new rows or updation of preexisting values, and then update the tables. Is there an...

OleDbCommand can't excute this command, Why?

I create a table named "PathTable" in a MS-Access DB. The table is like this: ------------------------------ | IP | Input | Output | ------------------------------ | 127.0.0.1 | XXXXX | YYYYYY | ------------------------------ When I programed these String CommandString = "SELECT Input, Output FROM PathTable WHERE IP = '127.0.0...

Copying ms-access databases

I think access databases should not be copied while a connection to them is open (.ldb locking file exists) as the copy file can be corrupt. However will the copy file be corrupt only if a edit/add/delete is carried out while the file is being copied. I'm thinking of situations where a connection to the database is left open all the whil...