Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
1
votes
1
answers
272
views
What is MS Access ODBC SQL syntax for a table with AutoIncrement and Memo columns?
I am migrating a full framework .NET app to core. It used ADOX to create an MS Access database and tables. It used OLE DB to populate data. In ADOX, the data type was `ADOX.DataTypeEnum.adInteger` and the syntax from c# was: fld.Properties["Autoincrement"].Value = true; fld.Properties["Seed"].Value...
I am migrating a full framework .NET app to core. It used ADOX to create an MS Access database and tables. It used OLE DB to populate data. In ADOX, the data type was
ADOX.DataTypeEnum.adInteger
and the syntax from c# was:
fld.Properties["Autoincrement"].Value = true;
fld.Properties["Seed"].Value = 1;
fld.Properties["Increment"].Value = 1;
For memo
, ADOX data type was ADOX.DataTypeEnum.adLongVarWChar
.
Since we can no longer use ADOX under .NET Core, I have to use SQL DML through ODBC. When I attempt to create a table using syntax similar to
create table t (
col1 int not null identity(1,1),
col2 varchar(512)
)
I get a syntax error. When I try to adjust this for Access according to this and other related articles in the same documentation tree, I also get syntax error.
create table t (
col1 counter,
col2 text
)
What is the correct syntax for these columns that is compatible with .NET Core and MS Access ODBC driver?
Gandon Jank
(37 rep)
Dec 28, 2020, 08:02 PM
• Last activity: May 14, 2025, 12:02 PM
3
votes
2
answers
16887
views
What DSN file is MS Access using for ODBC Linked Tables?
I set up a linked tables in Microsoft Access to connects to an remote database using ODBC with a File DSN. But which DSN file is Access using now? I want to examine it and compare it with the other versions. The Linked Table Manager only lists the tables and the name of the database. I tried renamin...
I set up a linked tables in Microsoft Access to connects to an remote database using ODBC with a File DSN. But which DSN file is Access using now? I want to examine it and compare it with the other versions.
The Linked Table Manager only lists the tables and the name of the database.
I tried renaming all of the DSN files I could find, and the ODBC connection still runs. Is Access storing the connection string itself?
taddy hoops
(141 rep)
Aug 7, 2015, 01:39 PM
• Last activity: Mar 17, 2023, 09:27 PM
1
votes
0
answers
347
views
Select value and display in a combobox if the datetimepicker value lies between two extreme dates in a table in database
I am creating an attendance management system in vb.net and using MS access as my database. I created a leave form in which the student on leave has a roll number and his details along with the from date and to date field.[![This is the leaves table][1]][1] What I'm trying to do is to show all the r...
I am creating an attendance management system in vb.net and using MS access as my database. I created a leave form in which the student on leave has a roll number and his details along with the from date and to date field.
What I'm trying to do is to show all the roll numbers of students in the
this is the code and query:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
con.Open()
Dim cmd1 As New OleDbCommand("Select roll_no From leaves Where semester= " + ComboBox3.SelectedItem + " and (from_date= #" & DateTimePicker1.Value.ToShortDateString & "#)", con)
Dim da1 As New OleDbDataAdapter
da1.SelectCommand = cmd1
Dim dt1 As New DataTable
dt1.Clear()
da1.Fill(dt1)
ComboBox4.DataSource = dt1
ComboBox4.DisplayMember = "roll_no"
ComboBox4.ValueMember = "roll_no"
con.Close()
End Sub
Is there any modification in query through which I can get my desired results to get all the roll no if

ComboBox
on leave if the DateTimePicker
value is in between the to date and from date, the command that I created as MS access query is selecting the from date and to date ie., extreme dates matching with the DateTimePicker
value but not showing the values if date is between the to and from date.

DateTimePicker
value is between dates in database?
Vivek
(11 rep)
Jan 31, 2022, 07:28 AM
0
votes
1
answers
631
views
How to connect UDL file to a Msaccess DB 2007 (Protected with password)?
The UDL file was connected `to MS Access DB 2007` successfully. However, when I have protected the DB with a user the connection failed. Can any one show us how to solve this problem ? [![DB driver Name][1]][1] [![Connection successful before password][2]][2] [![This error after password enabled][3]...
The UDL file was connected
to MS Access DB 2007
successfully. However, when I have protected the DB with a user the connection failed.
Can any one show us how to solve this problem ?



Yousef Albakoush
(11 rep)
Dec 26, 2018, 11:55 PM
• Last activity: Oct 3, 2021, 12:35 AM
2
votes
2
answers
60844
views
Combine multiple row's records in one row with MS Access Query?
I have a table (name- tbl2) with 21 column but I want to combine multiple rows records in a row by using a unique reference number as below: **Table Field and Records Type** [![enter image description here][1]][1] **Expected Result:** [![enter image description here][2]][2] Please help me to resolve...
I have a table (name- tbl2) with 21 column but I want to combine multiple rows records in a row by using a unique reference number as below:
**Table Field and Records Type**
**Expected Result:**
Please help me to resolve this issue.


Jonas Ronald Costa
(63 rep)
Feb 4, 2016, 11:55 AM
• Last activity: Sep 10, 2021, 10:41 PM
0
votes
1
answers
146
views
MS Access : Navigation pane is suppressed
I received a MS Access form client. It is in access 2007 format. Initially Navigation Pane was not available. Only form was visible. Then I choose options->Current database->checked Display Navigation Pane check box. It is visible now. But It is suppressed and not able to resize or access it as show...
I received a MS Access form client. It is in access 2007 format. Initially Navigation Pane was not available. Only form was visible. Then I choose options->Current database->checked Display Navigation Pane check box. It is visible now. But It is suppressed and not able to resize or access it as shown in below screenshot. I checked the code by pressing Alt+F11. I could not find script related to navigation pane. Please advise.

Shiva
(807 rep)
Aug 26, 2015, 10:53 AM
• Last activity: May 7, 2021, 11:05 AM
0
votes
0
answers
31
views
how to Manipulate duplicated records using access
Using Microsoft Access, I have a number of records that have duplicated field-1. I need to form a query such that the duplicate records get unique ; BUT the next filed-2 data must be seen in columns next to each other the same no. of times. For example, now I have a table like this: field-1 | field-...
Using Microsoft Access, I have a number of records that have duplicated field-1. I need to form a query such that the duplicate records get unique ; BUT the next filed-2 data must be seen in columns next to each other the same no. of times. For example, now I have a table like this:
field-1 | field-2
1 | date1
2 | date1
1 | date2
3 | date1
3 | date2
1 | date3
And query output needed:
field-1 | (1st-duplicate) | (2nd-duplicate) | (3rd-duplicate) | .... (nth-duplicate)
1 | date1 | date2 | date3
2 | date1
3 | date1 | date2
How I can do that ?
user4549384
(1 rep)
Mar 19, 2021, 06:17 PM
• Last activity: Mar 19, 2021, 06:40 PM
0
votes
3
answers
1717
views
Restrict Front Ended User access to Form entry only
I have a front end database that I want to restrict user access to only enter data into a form. I do not want them to be able to scroll through other entries via the form. How can I restrict this in Access 2007-2010?
I have a front end database that I want to restrict user access to only enter data into a form. I do not want them to be able to scroll through other entries via the form. How can I restrict this in Access 2007-2010?
Tammy
(1 rep)
Apr 15, 2016, 03:02 PM
• Last activity: Jul 30, 2019, 07:12 AM
1
votes
1
answers
113
views
MS Access 2000 Application - SQL Server
I have an old MS Access 2000 application which connects to a SQL Server 2000 database. I need to migrate this database and application to a new server with SQL Server 2012. The Access application is running locally on my user's workstation. Should I upgrade the Access database to a new version then...
I have an old MS Access 2000 application which connects to a SQL Server 2000 database. I need to migrate this database and application to a new server with SQL Server 2012. The Access application is running locally on my user's workstation.
Should I upgrade the Access database to a new version then create a new connection to the 2012 SQL Server (new adp file)? The application is unsupported and we need to move the database to a new server.
EASTBAY_DBA
(11 rep)
Apr 5, 2018, 03:11 PM
• Last activity: Apr 6, 2018, 10:45 PM
1
votes
2
answers
97
views
Back-end with encription and user-control for MS Access2003-VBA
My client has an Access 2003 "multi-user" (<6) "database" (<3k records) with "encryption" located in a LAN folder and an easy Form I polished with VBA(DAO library). Access 2003 encryption can be broken in less than a second with very easy tools. A decent level of encryption should be applied to the...
My client has an Access 2003 "multi-user" (<6) "database" (<3k records) with "encryption" located in a LAN folder and an easy Form I polished with VBA(DAO library). Access 2003 encryption can be broken in less than a second with very easy tools.
A decent level of encryption should be applied to the data (and maybe user control). My client needs an "easy" solution; something they can manage on their own (like they did with the access mdb file) without the help of engineers.
Some computers have access 2003, some Access 2007 (so 2007's marvellous and straight forward encryption isn't a solution). Access 2003 refuses to connect to an access 2007 database via ODBC and also stores the passwords for linked tables in plain text (and doesn't ask for them).
I have thought of the following:
- Encripting individual fields. User generates a sha-512 hash that is substracted from every field to get the decrypted field. Problem: Manual editions of the Access table are common in this database.
- MySQL in a computer-server, they connect to the database via ODBC. Or SQL Express (seems better with Access). Problem: Someone has to configure and manage the server periodically. It seems disproportionaly complex given the scarce amount of data and the not frequent use of them. sqlite (which also has an ODBC driver) doesn't have good encryption, it seems.
I believe a complex solution in their case would have greater security risks than a simpler one...
- A mdb file inside a zip file, the decription consists of extracting the file when they need to use it. Would solve the problem but is not elegant or safe enough (if a hacker went into the remote folder when the database is opened he would gain access to all the data). The file is only opened once or twice every day.
What do you suggest? Do you have another ideas? I have thought many times and it seems I'll have to go for SQL Express 2008; I don't like this solution.
Thank you
A-B
(21 rep)
Mar 3, 2016, 08:59 PM
• Last activity: Mar 26, 2018, 03:04 PM
1
votes
1
answers
381
views
I need to hide an open Access table from users
For application startup I had to open a table as part of some DAO.recordSet code. DoCmd.OpenTable "User", acNormal, acReadOnly On running user tests, I want to distribute the desktop application as a run-time file (.accdr) but the access table is visible. All I can find is how to hide navigation are...
For application startup I had to open a table as part of some DAO.recordSet code.
DoCmd.OpenTable "User", acNormal, acReadOnly
On running user tests, I want to distribute the desktop application as a run-time file (.accdr) but the access table is visible. All I can find is how to hide navigation area objects.
I, of course, do not want the table visible to users, so my question is how do I hide it?
Marcus Mackaku
(23 rep)
Jun 6, 2017, 07:50 AM
• Last activity: Jun 6, 2017, 06:28 PM
0
votes
1
answers
989
views
MS Access Crash on DAO connection
Can someone take a look at this code and provide a hint as to what it is I am doing wrong. This code taken almost literally from a reference book, as an example on how to use VBA ADO object. Here is the code: `Sub TestMyADODB() Dim mySQL As String Dim myConnection As DAO.Connection Dim myRecordSet A...
Can someone take a look at this code and provide a hint as to what it is I am doing wrong. This code taken almost literally from a reference book, as an example on how to use VBA ADO object. Here is the code:
`Sub TestMyADODB()
Dim mySQL As String
Dim myConnection As DAO.Connection
Dim myRecordSet As DAO.Recordset
Set myConnection = CurrentProject.Connection ' Crash here
mySQL = mySQL & "UPDATE Amplifier "
mySQL = mySQL & "SET Amplifier.lngCategory = 405, Amplifier.lngSubType = 3 "
mySQL = mySQL & "WHERE (((Amplifier.lngPartIndex)=9))"
myRecordSet.OpenRecordset mySQL
Debug.Print "DONE"
myRecordSet.Close
Set myRecordSet = Nothing
Set myConnection = Nothing`
Furthermore, I tried using the ADODB object, result, the compiler will not permit the code. I found I needed to add a reference to the MS dll, which I did, still the same result. Then I started getting an error from VBA stating that I cannot use DAO which is now " Outdated " and that I must use ADO.
The rest is 10 hours of lost precious time trying to demystify the ADO DAO issue from multiple articles on tne web. Bottom line, my Access 2007 will literally crash if I use DAO and the compiler will refuse to use ADO.
I am loosing my hairs over this issue, and I need help! Appreciate
PS: The mySQL string has been tested in an Access query and functional.
Fred Cailloux
(103 rep)
Jan 29, 2017, 03:55 PM
• Last activity: Jan 29, 2017, 05:01 PM
1
votes
0
answers
133
views
how to edit kvp data as crosstab/pivot
I am keeping data in key/value pairs. I know how to convert that data into crosstab form using queries like this: SELECT master.tag, MAX(CASE WHEN data.key = 1 THEN data.value ELSE NULL END) AS F1, MAX(CASE WHEN data.key = 2 THEN data.value ELSE NULL END) AS F2, MAX(CASE WHEN data.key = 3 THEN data....
I am keeping data in key/value pairs. I know how to convert that data into crosstab form using queries like this:
SELECT master.tag,
MAX(CASE WHEN data.key = 1 THEN data.value ELSE NULL END) AS F1,
MAX(CASE WHEN data.key = 2 THEN data.value ELSE NULL END) AS F2,
MAX(CASE WHEN data.key = 3 THEN data.value ELSE NULL END) AS F3
FROM master left join data on data.master_id= master.id
GROUP BY master.id
In fact I am using more complicated version with dynamically created query, providing only fields which exist for selected master records.
This solution provides read-only recordset. Now, how to create a similar updatable recordset ?
I see three solutions, but none of these looks good:
1. Use joins like the code below:
SELECT master.tag,
data1.value AS F1,
data2.value AS F2,
data3.value AS F3
FROM master
inner join data as data_1 on data_1.master_id=master.id and data1.key=1
inner join data as data_2 on data_2.master_id=master.id and data2.key=2
inner join data as data_3 on data_3.master_id=master.id and data3.key=3
Performance is terrible at 10 joins and only a few master records.
2.
Use view (read-only) to export current data along with data table id's and write own table editor.
This option is not practical. A form with custom update handling could be doable and useful but is not sufficient for me / does not cover all user tasks.
3. Create a temporary table with triggers in a SPROC. Edits would be made on this table and all changes would be forwarded to KVP storage by triggers.
This option looks the most practical, but there are issues with table lifetime. I have to use regular tables because true temporary tables can not have triggers. Each user may open more than one table. I have to find a way to detect which tables are no longer needed.
The question is are there any better options than the 3 above?
If not, how to implement option 3 properly?
Bakground:
The backend is MySQL, the frontend is MS Access 2007.
Data is very irregular. There will be 60-150 various keys in KVP table but only 15-30 will be used for a given master row. Data can be grouped in classes and each class has specific set of keys. There can be 1-30 instances of each class. The idea is to let the user work like it was a regular table but limiting rows to one or a few classes and showing only columns (keys) which exist in all classes/rows.
pppp
(11 rep)
Feb 28, 2016, 11:18 PM
• Last activity: Mar 3, 2016, 09:42 PM
2
votes
0
answers
180
views
Moving from MS Access to SQL Server 2012, need help with column history
I'm moving an access database from all the data being in MS Access to MS Access being just a frontend, but I'm having trouble figuring out how to do a sort of column history. I have a `tasks.description` column, and in another table `descriptionLog`, I have `ID`, `Description`, `DateTime`, and `Task...
I'm moving an access database from all the data being in MS Access to MS Access being just a frontend, but I'm having trouble figuring out how to do a sort of column history.
I have a
tasks.description
column, and in another table descriptionLog
, I have ID
, Description
, DateTime
, and Task
. Task
is the ID
of the task from the Task
table. I was able to do this using data macros, but I need it to be agnostic from MS Access.
I've read a few guides on change tracking but I'm not sure how to get the data out.
Detail on column history: column history is a functionality of MS Access databases 2007 and up where you can set a memo column to be append only, keeping a log of what was entered or removed from the column.
Johnley
(93 rep)
Jul 30, 2015, 08:41 PM
• Last activity: Aug 1, 2015, 09:51 PM
2
votes
0
answers
115
views
MS Access database returns multiple entries for same person with more than one child
I know this is a very basic question, but I've watched about six Access database videos and still can't find the answer. I'm a volunteer creating a membership database for a church in MS Access. The children are in a table separate from their parents. When I query the two tables for the data which I...
I know this is a very basic question, but I've watched about six Access database videos and still can't find the answer. I'm a volunteer creating a membership database for a church in MS Access. The children are in a table separate from their parents. When I query the two tables for the data which I will then use in a Word mail merge, if a person has more than one child, that person will have more than one entry in the query results.
- How do I return just one entry for a parent with more than one child?
- Is it a Grouping function?
This is a basic question, for say a customer database, where a customer has more than one order, but I cannot find the answer.
Thank you.
Amanda Lietman
(21 rep)
Jul 16, 2015, 08:45 PM
• Last activity: Jul 16, 2015, 10:06 PM
1
votes
0
answers
137
views
Named a table “order” in Microsoft Office Access database and the webapp now can't see the table (even after renaming it)
I am creating a web application in Dreamweaver using ASP VBScript. The web application is a store and I have to implement a database into it (which I did). I created a table in my database called order and for some reason I couldn't dynamically enter the data from a record set that I wanted to. I se...
I am creating a web application in Dreamweaver using ASP VBScript. The web application is a store and I have to implement a database into it (which I did). I created a table in my database called order and for some reason I couldn't dynamically enter the data from a record set that I wanted to.
I searched on Google and came across someone saying that order is a reserved word and that I should name my table something else. I did so (several times, several names, and even new tables with the same fields, thinking I could use this table, no joy.) But ever since, whenever I try to create a new recordset I am only picking up the old table (the one named order, the other two table are working fine).

I couldn't see the new renamed table fields when creating a recordset no matter how much I refreshed the database window.

I am able to access the database that I want to use when I double click the database through Local view or Remote View (I can't find the old DB anywhere). The problems arise when I want to use the data from the order recordset (since this is the recordset it is forcing me to use even though I can't). I am getting this error when I press on the + button of the recordset that is related to the order table
> [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
So when I go and change this code to the name of an existing table in my DB (which is now orders) I then get this error
> [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot find the input table or query 'Orders'. Make sure it exists and that its name is spelled correctly' .
Here's the DB:

Here's the code where the problem is:
I can't create a brand new DB and start over because I need my lectures login credentials as it is on the college's server and it's a bit too late to do that now, sadly.
COYG
(111 rep)
Jan 15, 2015, 10:28 PM
• Last activity: Apr 2, 2015, 02:18 AM
0
votes
1
answers
421
views
How to save the design of an Access database -- not the content -- as text?
How can I save the *entire* design or specifications of an Access 2007 database -- not the data *content* -- as text? I have fallen foul of the "Enter Parameter Value" bug whereby a query pop-up shows an out-of-date query name -- despite having the Name AutoCorrect Options turned on *and* having run...
How can I save the *entire* design or specifications of an Access 2007 database -- not the data *content* -- as text?
I have fallen foul of the "Enter Parameter Value" bug whereby a query pop-up shows an out-of-date query name -- despite having the Name AutoCorrect Options turned on *and* having run Compact and Repair Database.
I have read that Name AutoCorrection is buggy.
I've also read that it was possible to save an object as text (in an earlier version of Access) and think this would be a valuable means of making name changes everywhere -- queries and forms as well as tables.
Please do not try to convince me not to change names; that may only make me more determined to do so ;-)
Martin F
(311 rep)
Feb 24, 2015, 07:54 PM
• Last activity: Mar 25, 2015, 05:09 PM
2
votes
1
answers
418
views
Changing data source on Access front end
I feel bad asking this, as I am only using an Access front end temporarily, but I have been asked to migrate an access 2007 db to mysql with a php front end. I have moved the data to mysql and am working on the ~400 forms, reports, etc, but want the users to have access to the system while I am deve...
I feel bad asking this, as I am only using an Access front end temporarily, but I have been asked to migrate an access 2007 db to mysql with a php front end. I have moved the data to mysql and am working on the ~400 forms, reports, etc, but want the users to have access to the system while I am developing the new one.
I have little experience with access and although I have been able to connect to the mysql tables, the forms don't seem to update their data sources.
Is there a way to update the entire access front end to the new tables? Or am I missing something really simple and straightforward. I've googled extensively and I've read all the "similar questions" presented on the page where I am typing this and can't an answer which seems to apply.
Thanks for any help or links offered.
dt647146
(23 rep)
Feb 1, 2015, 11:10 PM
• Last activity: Feb 2, 2015, 04:07 AM
3
votes
2
answers
1349
views
Rearranging Data in an MS Access 2007 table into a new table format/Result Output
I have Access tables that have the following format: -------------------------------------- |Name |Math|Science|Reading|Civics| -------------------------------------- |Mike | A | C | A | B | |John | B | A | A | B | |Randy| A | C | A | A | |Sasha| B | C | D | A | |Max | A | C | A | A | |Jenn | A | A...
I have Access tables that have the following format:
--------------------------------------
|Name |Math|Science|Reading|Civics|
--------------------------------------
|Mike | A | C | A | B |
|John | B | A | A | B |
|Randy| A | C | A | A |
|Sasha| B | C | D | A |
|Max | A | C | A | A |
|Jenn | A | A | A | C |
-----------------------------------
Is there any Access Sql code or Access VBA script that I can use so that I can convert (or output in a query/resultset) the above table in the below format?
--------------------
| Name |Grade|
---------------------
|Mike Math | A |
|Mike Science | c |
|Mike Reading | A |
|Mike Civics | B |
|John Math | B |
|John Science | A |
|John Reading | A |
|John Civics | B |
|Randy Math | A |
etc...
What I have found so far are the below 2 threads which shows how to bring in all the field names into an array or just basic output using VBA in Access. It's a start for what I am trying to accomplish (since in essence I will need to bring in the field names into the first column). I'll post back if I'm able to figure it out.
https://stackoverflow.com/questions/11548697/how-to-list-fields-name-in-table-in-access-using-sql
http://forums.asp.net/t/1143922.aspx
I'm wondering If I can do something like...
For each fieldname in table (where fieldname != Name)
Begin
select
Name + ' ' + Subject as Name,
(select Grade from table where Name = Name and Subject = Subject) as Grade
End
Juan Velez
(3303 rep)
Jan 26, 2014, 10:56 PM
• Last activity: Aug 5, 2014, 08:58 AM
1
votes
1
answers
28271
views
How to convert sql server table data into MS Access(.mdb) file
I have SQL Database table with 6664055 rows, I want to convert this SQL Server table data to MS Access format(.MDB), How Can I do this?
I have SQL Database table with 6664055 rows, I want to convert this SQL Server table data to MS Access format(.MDB), How Can I do this?
vivek
(91 rep)
Feb 28, 2014, 07:40 AM
• Last activity: Feb 28, 2014, 08:02 AM
Showing page 1 of 20 total questions