Click here to Skip to main content
15,887,596 members
Everything / Productivity Apps and Services / Microsoft Office / Microsoft Access

Microsoft Access

MS-Access

Great Reads

by William Hey
Classical number theories
by Rob Culhane
How to dynamically add access database columns at runtime using VB.NET
by William Hey
Semi-Prime Ordered Sequences (Part 2) is the follow-on to “Exploring Computational Number Theory (Part 1)” and describes a process for ordering the semi-prime base sequences.
by Clifford Nelson
This is a tip that has the code for selecting an Excel file and sheet for import into Microsoft Access. This includes the code required to browse for a file, and populate a ListBox with the sheets of the Excel Workbook, and the code to import an Excel spreadsheet.

Latest Articles

by DotNetLead.com
Azure AD for authentication and authorization of users for your website
by Gustav Brock
Format amounts in VBA using the Indian number format for currency and amounts
by Clifford Nelson
Method to change source of a Form’s Subform source to a Query or Table in Microsoft Access

All Articles

Sort by Updated

Microsoft Access 

7 Jul 2023 by Member 13865334
I have same problem. I install my app in my laptop customer. remote. I have success when install at his staff laptop. but, failed when install at him. the message is: provider not found. my suggest is: 1. windows 11. 2. office 2019. last,...
7 Jul 2023 by QuickBooksDev
We have an existing VB.Net 2017 app that has been running for years on Windows 7. It's using an access database. The system was updated to Windows 10 and access to 2019. If fails on both a 32 bit and 64 bit office of access 2016 and 2019. Error 3706 Provider cannot be found. It may not be...
10 May 2023 by Jeffery Tengen
I have three (3) ListBoxes, wvListBox, ivListBox & cpListBox. All designed from three (3) separate Queries. wvListbox and ivListBox are designed to submit records upon a Double Click on each record, to the cpListbox. In a nutshell, cpListBox acts...
22 Mar 2023 by Member 9430088
When i execute this nothing happens the datagridview does not update public void Search() { OleDbCommand ocm = new OleDbCommand("SELECT Firstname FROM students WHERE Firstname LIKE '% Hello %' ", conn); conn.Open(); ocm.ExecuteNonQuery(); conn.Close(); }
22 Mar 2023 by hisham elmsry
LINQ-To-DataSet (which i prefer): var filtered = tb.AsEnumerable() .Where(r => r.Field("CREATOR").Contains(searchstring)); ADO.NET(DataTable.Select): DataRow[] filteredRows = tb.Select("CREATOR LIKE '%" + searchstring + "%'");...
4 Feb 2023 by Christian Torrico
Hi,i wanted to ask if there was some way to get the server date from a Microsoft Access database.I know about Date() and Time() methods, but in SELECT they give me local time. Can you give some help with this?
4 Feb 2023 by Member 15914427
If it is a local server you can, try this procedure Private Sub btnServidorLocal_Click() ' Reference Windows Script Host Object Model Dim cmdShell As New WshShell Dim cmdEjecute As WshExec Dim cmdInstruccion, hora, dia, tem As String ...
25 Jan 2023 by sarfarazbhat
Hello everyone, I am currently developing a project in VB.Net and Ms Access and now, I got stuck while creating a crystal report where I need to display columns from three access tables which I am able to fetch using a query in Access. But the...
4 Jan 2023 by The_Life
FriendsI have created a table in ms-access table.in that i created the invoiceno field as autonumber.now i finished the project.i deleted all the testing data in the table.while im deleting the autonumber was 1027after deleting the data completely from the table.i tried to insert a...
4 Jan 2023 by lino magri'
compact the database and then try the insert again
12 Aug 2022 by just_123
I did it with this Python code (link attached)
12 Aug 2022 by basurajkumbhar
Hi all of you,I have created one application in vb.net and i am used mdb database.It works fine there is no any problem in that application.I want to convert all mdb table or data in that database to Sqlite.In my database there are 3 lakh above record it take some time to load data...
7 Jul 2022 by Purnendu Paul
Respected, In a stock Management project (VB6.0) I'm fetching a problem during updation of a table in respect of another table in same database (MS ACCESS). Netstock Table: Category Item Variant Brand P_Qty S_Qty Unit Gel Pen Agni...
7 Jul 2022 by CHill60
Look at your sub-query SELECT Inward.Item, Inward.Category, Sum (Inward.P_Qty) From Inward GROUP BY Inward.Item, Inward.Category, Inward.Brand It is returning 3 columns in the result set, yet you are trying to assign all three values to a single...
7 Jul 2022 by DimA__B2
Hello everyone, I have a problem and i need your support. I need C#.net software and need connection MSAccess 2003 database "mdb" with security from "file working group"(mdw). my code is: OleDbConnectionStringBuilder csbOLE = new...
7 Jul 2022 by CHill60
Have a look at the resulting connection string - which should look like this Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Mybase.mdb;Jet OLEDB:System Database=C:\MySysBase.mdw;User ID=Admin;Password=*; I.e. without the "Jet OLEDB:" bit on the...
30 Jun 2022 by Muthu Kumar
use c# and Msaccess i just add value like this Mc access column data type (text,numeric-double,text,numeric-percentage) but i insert this values(john,"","","")this one value value not inserted this error because i have only name listdata help me i need insert null values or submit...
30 Jun 2022 by Member 15692898
Try VALUES ('john',NULL,NULL,NULL). This uses the NULL keyword. I have used this for numbers, text and Date/Time fields.
28 May 2022 by Amar chand123
i try but i not able find Mistake in statement What I have tried: private void btnRegister_Click(object sender, EventArgs e) { if (txtUserName.Text != "" && txtPassword.Text != "" && txtConfirmPassword.Text != "") ...
28 May 2022 by Member 15094221
private void btnRegister_Click(object sender, EventArgs e) { if (txtUserName.Text != "" && txtPassword.Text != "" && txtConfirmPassword.Text != "") { if...
14 Apr 2022 by SukirtiShetty
I have one 2 Input Tables for ex: 1 Input Table DN0000001 DN0000010 DN0000001 DN0000013 10 .\Box0001\ Agreement.pdf Samsung .\Box0001\Dir001\Text\ DN0000011 DN0000013 DN0000001 DN0000013 3 .\Box0001\ Patent.pdf Samsung .\Box0001\Dir001\Text\...
12 Apr 2022 by z3ngew
Hello everyone, I have a problem and i need your support, I am currently working on a msaccess database management software using c#.net, I added a pasword the msaccess file, however when i try to open the file using C#.NET, it gives and error...
12 Apr 2022 by CHill60
Try public OleDbConnection Connection = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Application.StartupPath + "\\Database.mdb;" + "Jet OLEDB:Database Password=123456;"); Note the semi-colon inside the quotation marks. ...
21 Feb 2022 by ddrraamm
Hi,I have designed one vb.net application with ms access database.I use following connectionstring to Connect :Provider=microsoft.Jet.oledb.4.0;Data Source=D:\mydata.mdbI want to distribute this application to other users in LAN (Network)but should share common (centralized)...
7 Feb 2022 by anmar shamel 2022
i have a sport form called Frm_Sprt_Acnt it could be called from many subforms when call it I store the caller subform and its parent and control Ctr_CallerFormMain Ctr_CallerFormSub Ctr_CallerCtrl how I could return focus to caller control...
4 Jan 2022 by OriginalGriff
Pretty much, you can't - or at least not in a sensible way that will be easy to maintain. The problem is that you are trying to compile code into an existing and indeed running app and that always a pretty bad idea. Not to mention that it leaves...
4 Jan 2022 by Venu Gopal Mulavana Kayamkulam
Data already saved to access db templates_table.finalcontent as "Hi " + Trim(Me.txtClientName.Text) + vbCrLf + "We wishes a prosperous happy new year to you. -" + Trim(Me.txtFirmName.Text) I have fetched data to "FinalStuff" variable FinalStuff...
19 Dec 2021 by Member 15473035
This is Delete all ID in top 10 selected but not delete top 10 record
21 Nov 2021 by Kyudos
In (DAO) SQL, I can use ISAM to connect to an Excel sheet to import/export data using expressions like: SELECT T1.* INTO Temp FROM [Excel 8.0;HDR=YES;IMEX=1;Database=D:\test.xls].[Sheet1$A1:U65536] AS T1 Is there and equivalent way to connect...
19 Nov 2021 by CHill60
Try using OPENROWSET (Transact-SQL) - SQL Server | Microsoft Docs[^] SELECT CustomerID, CompanyName FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb'; ...
11 Nov 2021 by Sean Chikobvu
I have a code that brings out the above error each time i click the update button, i have tried changing the values both in MS ACCESS AND VB HERE IS THE CODE Try con.Open() cmd = New OleDbCommand("Update [Trainer] Set...
11 Nov 2021 by Dave Kreskowiak
First, you need to dump that abomination using string concatenation to build an SQL statement. That just leads to the problems you're seeing right now, as well as setting yourself up to have your database destroyed by malicious input. Basically,...
24 Sep 2021 by 1step-forward-2steps-back
All I want to do is add pictures to my database as OLE objects from my Asp.net page via C# and yet be able to open it (the picture) when working in Access itself… I found code on how to enter it into the database and according to Access the...
6 Sep 2021 by Kaise karen?
protected void Button2_Click(object sender, EventArgs e) { OleDbConnection con = new OleDbConnection(); con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Server.MapPath("~/Database/registration.accdb");...
6 Sep 2021 by Wendelius
As said in solution 1, always use parameters. Another observation is that you try to handle next key values in your program. This should not be done as it may lead to key conflicts, instead you should use the AutoNumber functionality in Access....
6 Sep 2021 by OriginalGriff
Don't do it like that: Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized queries instead. When you...
27 Aug 2021 by Member 11773323
I am trying to connect to access database but in the line that I wrote to open the connection:myConnection.Open()it throw the exception:Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available.the value of myConnection:myConnection = New...
27 Aug 2021 by Ravindranath_Kanojiya
Check if connection is already Open, if Open Then close first then try to Open
25 Aug 2021 by Abdelrahman-Dev
Hello, I have a C# winform application for selling books, And in my selling form I have some textboxes where the user can enter the name of the book, the amount, the price, etc... I have a button for inserting these values into an Access...
25 Aug 2021 by Richard Deeming
Quote: string cmdInsert = @"INSERT INTO SoldProducts (BookName, Amount, Price) Values('" + Convert.ToString(r.Cells[0]) + "', '" + Convert.ToString(r.Cells[1]) + "', '" + Convert.ToString(r.Cells[4]) + "')"; Not like that! Your code is...
24 Aug 2021 by Kaise karen?
I want to retrieve an auto number value from the ms-access database table from column name "id" using c# is asp.net and then I want to convert that auto number value to "ToInt64" as a string value. I have tried this but these queries are not...
24 Aug 2021 by OriginalGriff
And autonumber column is the same as any other column, except you can't write to it yourself. So a normal SELECT will retrieve it. If you are trying to INSERT a new row and then get the number that was assigned, then SELECT @@Identity...
19 Aug 2021 by Kaise karen?
string ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Server.MapPath("~/Database/registration.accdb"); using (OleDbConnection con = new OleDbConnection(ConnectionString)) { con.Open(); ...
19 Aug 2021 by Patrice T
There is a huge problem in your code, it is 'SQL Injection" : OleDbDataAdapter SQLAdapter = new OleDbDataAdapter("insert into...
19 Aug 2021 by Richard Deeming
There's one massive error in your code: it is vulnerable to SQL Injection[^]. NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query. Everything you wanted to know about SQL injection (but were afraid to ask) |...
18 Aug 2021 by Kaise karen?
if (!IsPostBack) { string ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Server.MapPath("~/Database/registration.accdb"); using (OleDbConnection con = new OleDbConnection(ConnectionString)) ...
18 Aug 2021 by Maciej Los
MS Access database engine is very specific.... When you use multiple joins, you need to use brackets, lie this: 2 joins: SELECT ... FROM (origintable JOIN jointable1 ON ...) JOIN jointable2 ON ... 3 joins SELECT ... FROM ((origintable JOIN...
17 Aug 2021 by Wendelius
Based on the error message the error is not raised when executing the query. Instead it seems that binding is incorrect. Re-check all the column names on the tables you have used in your query (size, tblcategory, and subcategory) and ensure...
17 Aug 2021 by اسمعیل حقبیان
ALTER TABLE Table1 ALTER COLUMN ID COUNTER(0,1)
16 Aug 2021 by Kaise karen?
protected void Button1_Click(object sender, EventArgs e) { { OleDbConnection con = new OleDbConnection(); con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +...
16 Aug 2021 by Patrice T
Quote: try to correct syntax error in the insert into statement The problem is that it is impossible to know what is wrong because of the way you build the query. Your query depends on the contains of variables including user input. In your...
16 Aug 2021 by OriginalGriff
Don't do it like that: Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized queries instead. When you...
16 Aug 2021 by Kaise karen?
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.OleDb; using System.Data; using System.Configuration; using System.IO; public partial...
16 Aug 2021 by OriginalGriff
Don't do it like that! Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized queries instead. When you...
9 Jul 2021 by Vivek Kumar
I have two tables with primary key and foreign key (ItemId) Table 1 (Items) ItemID ItemName OPStock OPStockValue 76 AML-MICRONUTRIENTS (40X250ML) 0 0 9 AML-MICRONUTRIENTS(50X100ML BOTTAL) 0 ...
7 Jul 2021 by CHill60
Quote: But the result is not correct Statements like this do not help us to help you. There is actually no result because your sql does not compile - there are insufficient columns in the group by clause. It needs to be GROUP BY I.ItemID,...
14 Apr 2021 by OriginalGriff
You can't. FTP is not a file system, but a protocol to transfer data, and it doesn't allow directly access to files. FTP is not made for this scenario, and will not work.
14 Apr 2021 by Paramu1973
Hi, I wish to have a connection string for my ftp server with Static IP, Any Sample Query will be helpful. My Codes:- MyConnectionString=" Provider=Microsoft.ace.Oledb.12.0; Data...
7 Apr 2021 by Paramu1973
Hi, I have 2 tables MyTbl1, MyTbl2 contains the followings And I wish to have a Select Query to get the Output like the table MySplittedTbl2 MyCodes Select * from MyTbl2 ?????????? MyTbl1 order_no, item_name, order_qty A001 Paper ...
7 Apr 2021 by CHill60
In theory it is possible - try searching using your favourite search engine with Quote: MS Access Split string into multiple records You will need to write some VBA to do this. However, that would not be a good solution. A better solution is for...
3 Apr 2021 by Joseph3163
I am trying to compare two text fields txtTrailerNumber and txtSealNumber to the database table Tab_TrailerDetails. [TrailerNumber] and [SealNumber] as listed in the table. I am trying to get the database to look at the trailer number entered...
3 Apr 2021 by thatraja
These might help you to fix it Type mismatch (Error 13) | Microsoft Docs[^] What is ‘Run-time error ‘13’: Type mismatch’? And How Do You Fix It?[^]
14 Mar 2021 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
19 Feb 2021 by Violet Heath
I would like to know: 1. time, when my Android phone was turned on/off (not just the last time), what events/activities happened (if possible) 2. time, when my USB flash drive (Windows) and files on it were accessed (not just the last time),...
14 Feb 2021 by kyrons
I have a datagridview and loaded with records from a browsed database and combobox with items (different colors). The datagridview has 4 columns, the ID, FullName, Teamname, and last is the teamcolor. I want to update or edit the text in...
14 Feb 2021 by Shah Samiur Rashid
I have done it in Vb.net and MySql. I have passed all the data from grid to stored procedure through array parameter and easily, i could process the data in the server. It is faster, based on my experience.
1 Feb 2021 by Gustav Brock
Format amounts in VBA using the Indian number format for currency and amounts
12 Jan 2021 by Maciej Los
Without having an access to the project we can't tell what FileBrowser is. I guess that it's a custom class or ActiveX component. I have found discussion about LstFiles_DblClick procedure in this thread: [SOLVED] Display Image from Binary data...
12 Jan 2021 by mojtabahakimian
I'm Using VBA MS ACCESS What is File Browser in this code ? where can i find it Please Help ↓ actually i don't know what is the file browser ? is that reference or ActivX What I have tried: Private Sub LstFiles_DblClick(Cancel As Integer) ...
5 Jan 2021 by Samir Ibrahim
Hello I have created an accounting application using vb.net + Sql server using typed Dataset and Linq2Sql. Now I want to create a second version for my application using MS-Access What is the best way to go for that? creating a second copy of my application? Can I have one form (item list)...
5 Jan 2021 by Samir Ibrahim
I ended up creating my own ORM using OleDbCommandBuilder In my case MS ACCESS and MSSQL Server both worked fine using OleDb.OleDbConnection Thank you everyone who put lights IN front of me.
26 Dec 2020 by Rub5
I'm working on a survey, with radio buttons. I have gotten to the point where I can insert a value (RB5=5) into the database, but it is not the selected one on the form. From the form I would like to select the radio button and have that...
26 Dec 2020 by Gerry Schmitz
You're inserting "RB5.Text" (?) each time. RB's usually don't have ".Text"; they have .Content (which could be text). Q1 needs to be set BEFORE the (db) insert, based on the Q1 reference. RB1 - RB5 isChecked should be mutually exclusive (based...
16 Dec 2020 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
15 Dec 2020 by Izzy Decorte
I'm trying to write a code snippet to make a simple backup from the access database in my software. Everything looks allright (i think) but i get an error when executing the code: error looks like this: Format of the initialization string does...
15 Dec 2020 by OriginalGriff
It's likely that you get an error because you are running an old version of your software - what you show above probably won't compile: System.IO.File.Copy(mydatabase & "\PatientenDatabase.accdb", String.Format(backupfolderdestination &...
12 Dec 2020 by mberger1959
The following code works and creates text dates such as 1/12/2004. In the loop below, I want a SQL statement to input that date into a new table, "NewDates" NewDates has 2 fields, ID (autonumber) and TestDate (Date/Time) The statement I want to...
11 Dec 2020 by mberger1959
I still get stopped at the following statement: TestDate = Format(txtRelativeList.Value, "yyyy-MM-dd") I get the feeling that the error is related to the fact that while txtRelativeList.Value is a string, it is not putting TestDate into a date...
10 Dec 2020 by CHill60
Your SQL is wrong. Try something like strSQL = "INSERT INTO tblNewDates (TestDate) values ('" & TestDate & "')" (Although note my comment above about SQL Injection[^] ) Now to the value of TestDate. Firstly, do not use Set with strings. ...
9 Dec 2020 by Gerry Schmitz
You need a "reference" to a database, among other things. INSERT INTO statement (Microsoft Access SQL) | Microsoft Docs[^]
8 Dec 2020 by s1a2b3
Hello ,I am New to Vb.Net 2008 with Access 03Sample Code : This Fill All Agents in Desc Order by Selected Country in DropDownDim Da As New SDS.OleDbDataAdapter("select AgentId,count(TripId) AS Trips from Trip where country='" & CmbCountry.Text & "' group by AgentId order by...
21 Nov 2020 by Aldo Foschini Gonzalez
Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Try Using conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Datos.accdb;") ...
21 Nov 2020 by Member 10630083
Private Sub Daftar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Daftar.Click If Nama.Text = "" Then MessageBox.Show("Sila Isikan Nama Anda!", "Amaran!") ElseIf Noic.Text = "" Then MessageBox.Show("Sila Isikan No I/C Anda!",...
8 Nov 2020 by Izzy Decorte
I'm making a database software where i want to give people the choice where to put the database (such as a central nas location or a server) in order to have the software on 2 or more computers. Therefore I made code to choose a database location...
7 Nov 2020 by Izzy Decorte
I make a database program where i can add new patients to an access table. In form1 i click button "add patient". form 2 opens with textboxes to fill in data. the data saves correctly but i want to update the patient datagridview on form 1 when...
7 Nov 2020 by OriginalGriff
Handle the Closed event in Form1 by adding it to the Form2 instance you create just before you call Show on it. When the Form2instance closes, the event will be raised, and you will have Form1 in Me as usual, and Form2 is passed to you as the ...
7 Nov 2020 by Gerry Schmitz
Use a "static" Observable Collection (OC). The form adds to the collection; the grid gets updated automatically using the OC as its data source; and the events fired when the collection changes can be used to update the Access db.
7 Nov 2020 by OriginalGriff
Set the location as a format string: Dim base As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=""{0}""" Dim strConnect As String = String.Format(base, strtext)
5 Nov 2020 by Dave Kreskowiak
Everything you listed is a possible cause, and then some. There is no way anyone is going to be able to tell you, "this is what's doing it". You're going to have to investigate all of these possibilities yourself. After checking the size of the...
5 Nov 2020 by   Forogar  
We are getting an unexpected (massive) slow-down in an Access 2016 VBA application over Citrix. No code changes, possible anti-virus update, possible Windows update, possible Citrix and Security updates. Perhaps the number of records has...
4 Nov 2020 by RickZeeland
A small example adapted from https://www.dotnetperls.com/dataset-vbnet[^] Public Class Form1 Public Sub New() ' This call is required by the designer. InitializeComponent() ' Add any initialization after the...
4 Nov 2020 by Izzy Decorte
In my form I have 3 textboxes in which i want to be able to enter data, press enter and it should search the word textbox1 = name or surname textbox2 = researchtype textbox3 = diagnosetype. the dataset gets loaded when i open the form this is...
4 Nov 2020 by RickZeeland
Try this: If e.KeyCode = Keys.Enter Then Dim table = Dossierset.Tables(0) table.DefaultView.RowFilter = "Rel_Naam= '" & Me.Pat_VoornaamTextBox.Text & "'" Me.DGVDossiers.DataSource = table End If You probably also need to declare table as...
4 Nov 2020 by Izzy Decorte
found it! basically i made too much effort in the datagridview itself in the form. Because i made it look like the way i wanted it to, i changed data that was critical to the loading correct code: Private Sub Dossiers_Load(sender As Object, e...
4 Nov 2020 by Izzy Decorte
I'm trying to fill a datagridview with data. the commented lines are the things i've tried but i don't get results... can you help me (i'm a beginner : first timer doing this type of coding) What I have tried: my current code is this: ...
3 Nov 2020 by RickZeeland
Try this: dgvDossiers.DataSource = DossierDataset.Tables(0)
28 Oct 2020 by Asad Khan
Use this connection string, it will work con.ConnectionString = "Password=passwordOfSSMS;Persist Security Info=True;User ID=LoginNameofSSMS;Initial Catalog=YourDataBaseName;Data Source=computerName
28 Oct 2020 by Babai JermenKeller Sasmal
Greetings to all experts, Well I have almost spend 2 weeks in codeproject and google for making a client-server program which works over LAN and maintain a ms-access database. All the answers and solutions I got are completely non-understandable and incomplete or non-relevant. So I decided to...