Click here to Skip to main content
15,889,865 members
Everything / ADO

ADO

ADO

Great Reads

by Daniele Fontani
.NET Core showcase: learn basics implementing a toy tool
by Kirill Panov
CDataGrid which was derived from CGridCtrl and used ADO for access to database.
by NavnathKale
Lightweight and simple
by Tharaka MTR
This post will show you how to fix orphaned SQL users.

Latest Articles

by Raphael Adeniji
Many a times, we need to programmatically manage GridView/DataGrid in Visual Studio web applications and this looks very difficult because we do not know what properties or events of the control to use. It may also be as a result of time constraint.
by peterswinkels
A Visual Basic 6 program demonstrating how to access databases using Microsoft ADO and how to automate Outlook and Excel.
by #realJSOP
A tool to generate model and viewmodel classes directly from your selected database
by #realJSOP
A rewrite of a previous article with more liquid nitrogen and bacon

All Articles

Sort by Title

ADO 

30 Sep 2010 by Phil J Pearson
I have a legacy C++ application using /clr calling a managed dll (written in C#)The app uses #import to reference ADOX. The dll also references ADOX.Everything is fine until I add a reference to my dll to the C++ project. Then I get hundreds of errors when compiling STDAFX.CPP related to...
1 Oct 2010 by Phil J Pearson
I got round the problem by removing the dll reference from the C++ project references and using #using "my_managed.dll" in a single cpp file (the only one that refers to the dll).Then the compiler warned me that it was unable to import some ADOX symbols from the dll because they had already...
8 Mar 2006 by KRucker
A description of how how to convert a .NET DataSet to an ADODB Recordset.
19 Jan 2015 by JatinKhimani
Develop a web application in 3 layer architecture code style
21 Oct 2014 by Peter Leow
Do not re-post, edit your original question instead.
7 Jun 2007 by callmepls
6 Sep 2005 by Carlos Antollini
Simple database access using an ADO class.
16 May 2013 by Joffrey Brouillet
This is an alternative for "A set of ADO classes - version 2.20"
25 Apr 2003 by Sriram Chitturi
This article gives a simple architecture of using StreamReaders and DataSets together to read data from arbitrarily formatted flat files into DataSets, using ini files as an example
18 Jan 2014 by Petr Ivankov
Application of abstract approach to database domain
25 Oct 2005 by fstrahberger
Access to Oracle without tnsnames.ora
26 Apr 2000 by Chris Maunder
A simple introduction to using Access .mdb databases in your ASP pages
3 Dec 2008 by new_phoenix
I need some assistance in accommodating an apostrophe in an SQL statement using VBA in MS Access. Please help.strSQLHyperion = "SELECT [COUNTRY], [TYPE], [BUSINESS_UNIT], " & _ "[ALT_GROUPING], [PERSONNEL_AREA], [L_R_G], [REGION],...
3 Dec 2008 by Jay Royall
You need to replace the apostrophy with 2 apostrophies. Best way is probably through a function (although I'm not sure of the exact syntax for VBA) - something like : Public Function MakeSqlSafe(strData) as string Return strData.Replace("'",...
3 Dec 2008 by Wendelius
Although replacing single apostrophe with double apostrophes will correct your problem, I think you should use parameters instead. Concatenating literal strings leaves you open to sql injections. Also using parameters gives a performance...
9 Jan 2016 by Snorri Kristjansson
Active Directory change auditing solution. A Windows Service that stores selected AD change events from the Security log of all Domain Controllers to an SQL database.
16 Mar 2011 by coderChina
I am doing some Coding using VC++ 6.0 . In the Project the client connect to a table in the server with SQL Server2008. I use the ADO for the Database issues. The client have to show the table data instantly show real-time graph. So I use the ado enents but there few materials...
8 Feb 2012 by aka_Rich
Hi Guys, I have some C++ code that is working in Real-Time with a decoder. Its job is to Insert into SQL 2008 R2 and its currently using ADO 2.8 to do it. However i dont want it to block while doing the Insert, because it holds up other packets arriving from the decoder. So i am trying...
8 Feb 2012 by Pablo Aliskevicius
I had something similar a few years ago, my program was reading from a file and inserting into a SQL database. I vaguely emember reading that asynchronous ADO required support from the underlying provider, and MS SQL Server did not provide that support. I used separate threads: one thread...
14 May 2014 by chinaprogramer
I have a question, I use c++ connect oracle database,i want use OS Authenticated to connect the oracle database,but i always failed,I have try many means to try,but all are can't do it.these are i had use ,but can't do it.OLE DB Provider for Oracle (from Oracle).For Standard...
8 Aug 2011 by ronhash
We use DAO to read database in C++.When we compile and run the application in 32 bit (on a Win7 64 bit machine) it works well.When we compile and it in x64, the connect fail:The connection string is simple:"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\db.accdb"the database in a...
8 Aug 2011 by barneyman
is this driver any use?http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=13255[^]
24 May 2013 by zlogdan
I am converting a real huge application from VS 2003 to VS 2010. One of its parts is a Windows service that pools http connections and makes database transactions with SQL Server. The 2003 project was running under Windows 2000 Server and now this converted/updated project should run on Windows...
30 May 2013 by KarstenK
so it is solved the easiest way :-)
21 Jun 2000 by Konstantin Vasserman
How to display multiple pages of records in ASP
23 Apr 2013 by PEANAFCONSULT
I am developing an application in Visual Basic 2010 that is accessing a database using ADOThe problem I have is that the reference to ADO seems to disappear when I clean the build.The error message I get is:'ADODB' is not declared. It may be inaccessible due to its protection...
30 Nov 2012 by Michal Kozel
Good day all,I encountered were strange problem during my work.When I call stored procedure from JScript (Jscript code is compiled by 3rd party desktop application that uses windows script 5.6) and give it data through parameters it ends up that data stored in database are different based...
10 Dec 2012 by Michal Kozel
in the end i was able to solve this problem.All was caused by ADO and its behavior when it encoded binary data from Local system language codepage to unicode.in this example it was on French system from codepage 1252 to unicode and on Czech from codepage 1250 to unicode.So I needed...
6 Mar 2019 by eramm01
I am migrating a VBNet programme from DAO to ADO. The database is an *.mdb database. In DAO I performed the following: Opened the database, created a recordset by using an SQL select command. I then could update using a recordset.edit/.update or a .addnew command. In ADO I do the folloing:...
6 Mar 2019 by CHill60
I'm with the others who are suggesting biting that bullet and updating to ADO.NET - especially as you are already spending ages trying to overcome the problems caused by using out-of-date technology. However, try the following to see if it gets you over your hump.. 1. I'm pretty sure it's the...
15 Mar 2013 by Foothill
I've come across an error that I cannot figure out why it is being generated.I am using ADO in an MS Access database to push a record to a SQL server using a stored proceedure.What is confusing me is that I am using cmd.parameters.refresh to populate the ADO command object so therefore, in...
15 Mar 2013 by Maciej Los
For the first look, you didn't add parameters: @Form_ID int, @State_ID int, @Form_Date nvarchar(50), @Filing_Type_ID int, @Revision tinyint, @State_Specific tinyint, @Filing_Date nvarchar(50) = null, @Filing_Status_ID int = null, @Approval_Date nvarchar(50) = nullSee this:...
15 Mar 2013 by Foothill
I found the problem. When I was executing the command, I had left in a bit of code that was trying to assign the stored proc's return (integer) to a recordset. That is why the procedure executed correctly and Access was still throwing an error.
10 May 2015 by Ankit Bansal MVP
This articles explains the insertion of data into SQL Database using Stored Procedures with Output Parameters. Some Bootstrapping is also used to create a good looking HTML.
12 Mar 2014 by anuragsapanbharat@gmail.com
HI,I have been trying to create a ADODB connection to an Excel 2010 files located in a web location. But my connection string s not working.Dim con As ADODB.ConnectionDim rs As ADODB.RecordsetSet con = New ADODB.ConnectionvPath =...
12 Mar 2014 by Maciej Los
Please, have a look here: How To Use ADO with Excel Data from Visual Basic or VBA[^] and follol the instructions. If it won't help, i need to warn you that there are known issues with x64 machines:Could not find installable ISAM[^]Accessing Excel files on a x64 machine[^]Finally, i'm...
11 Feb 2015 by Pravinkarne.31
Hello Team, I have cretaed a Tool in MS Access 2007 to generate few reports in Excel. This tool is running perfectly fine till y'day since last two years. But Today I have upgrated MS Office 2007 with MS office 2010 (Except Access - So MS Access I have is 2007) Now when I run my...
12 Feb 2015 by M Mehta
Hi,Use the code as followsDim con As New ADODB.Connectioncon.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & CurrentProject.FullNamecon.Open;;; your code ;;;;con.CloseHope this helps
7 Feb 2012 by jdandes
I would like to know if this is possible. Thanks.Public conn() As New ADODB.ConnectionPublic Sub ConnectDatabase1(ByVal SERVER As String) Dim i As Integer For i = 1 To 10 conn(i).CursorLocation = adUseServer conn(i).ConnectionTimeout = 50 ...
13 Aug 2016 by Tacitonitus
I don't usually try to solicit help online (unless it's for some software technology that is not very well known, like, say, CUDA), but this problem has me tearing my hair out, as they say (I have too little hair to actually do that in the literal sense, but whatever)..BTW, this is a C++...
13 Aug 2016 by KarstenK
It looks like in your code logic is some design flaw. Check every step because on some assumption you are doing something wrong. My best guess are accessing the db:a) with read/write is wrong or b) some version mismatch. (a newer db accessed with an older driver or statement)Consider...
14 Aug 2015 by Member 11823189
I have a dynamic data enabled website and loaded a ado net model. I then added a custom page list to one of the tables that page is below. All is the generated code except the ajax toolkit script manager and autocomplete extender which I added. I get an error in ie 11 saying sys undefined...
14 Sep 2006 by salysle
This article describes an easy approach to examining all of the tables, views, and columns in a database.
29 May 2017 by tranthanhtu.vn
In this article, We will learn why do we need to manage the stages of our application.
29 May 2017 by tranthanhtu.vn
In this article, we will learn how to build and deploy the code
21 Oct 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Here we answer specific questions which members face during programming. We can't work on the whole source code. You need to do that yourself.If you face any difficulty while coding, feel free to come back here and ask another question with specific issue describing the scenario....
8 Sep 2017 by Daniele Fontani
.NET Core showcase: learn basics implementing a toy tool
27 Nov 2012 by irol
Hello,I need to execute sql queries in asynchronous manner.Any examples ?Thanks in advice.Irek.
27 Nov 2012 by Volynsky Alex
Hi iron,For exampple it is possible to do with C++/Qt....Sometimes, it's necessary to execute some queries to database in asynchronous way (multi-thread), for example to avoid to freeze a GUI if a query is too long to execute.To make easier to work with asynchronous queries, QxOrm library...
26 Aug 2008 by Sunset Towers
I'm not familar with SQL, I get around with the basics which usually works fine for me.However, I've come up with a situation where the code will no not run from a SQLDatasource object in VS. I have, however gotten it to run properly from SSMSE...
26 Aug 2008 by Mycroft Holmes
you are right, it is very simple. Read BOL.CREATE PROC MyProc--Declare @MemberID INT AsSELECT Members.dbo.Members.LoginID, dbo.Categories.CategoryName, dbo.Listings.ListingID, dbo.Listings.Title, dbo.Listings.HasPhoto,dbo.Listings.IsTaken,...
21 Jan 2014 by joyjhonson
Hello Everyone,I had VB code that uses activeX datagrid. I converted the VB code to VB.net and replaced Activex data grid with .net Datagridview.Now, I see a event with ActiveX datagrid i.e BeforeColEdit event. I observed that, the Activex datagrid control is read only. I am not able to...
1 Mar 2014 by CHill60
The BeforeColEdit event is fired when a User starts to type into the Grid (but before the keystrokes are inserted) - reference here[^]So the corresponding event in the DataGridView control will be CellBeginEdit - reference here[^]You may also find useful this article [^] on the...
7 Aug 2008 by Ziyad Mohammad
This article explains the best strategy to be followed while designing data storage applications by System Architects
22 Sep 2010 by T2102
I believe the problem below is related to BOOST threads versus .NET threads even though I was able to isolate the leak to a single line. When I run the same code with .NET threads using ADO .NET directly, my memory usage is about 45 MB versus > 1 GB before.I have a block on code that uses...
5 Aug 2013 by Hetal Jariwala
I need small amount of user information to store. can i use access as a database??:laugh:
5 Aug 2013 by Thanks7872
Yes of course you can. Refer to these links.ASP.NET Form with MS Access Database with Form Validation[^]How to retrieve and display records from an Access database by using ASP.NET, ADO.NET, and Visual C# .NET[^]Regards..:laugh:
5 Aug 2013 by Code-Hunt
connect-to-access-database-in-...
1 Dec 2014 by AlwaysLearningNewStuff
I am trying to insert a file into MS Access database, into a field of OLE Object type. I am using C++ and ADO.I think that my problem is mishandling variants since this is the first time I use them. I am learning from this code example[^] but have problem understanding how to insert file...
1 Dec 2014 by KarstenK
You should NOT insert a file into the db. Best practice ins saving files is to give them a unique name (UUID-like) and store them in a special folder, somewhere on the db-server. You must also save the original file name.The error in your code is on the use of VT_UI1 and the size of...
26 May 2016 by Gayle123
I got a error when trying to oepn a database(.mdb) file througu using ADOclass.The error message is mentioned below "cannot open a database created with a previous version of your application"Could you please let me know how to solve the problem.What I have tried:CDAO...
26 May 2016 by OriginalGriff
Don't post this under Quick Answers - if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.Posting this here relies on them...
19 May 2022 by Member 3892343
I have an application in VB .Net that connects to a database MS SQL. It is connected to a datagridview, the problem is when I add a new record when I update the dataset it accepts the 2 first cell values but the third cell becomes blank, if I...
4 Apr 2011 by Member 3344783
I am using ADO .net to write a string to a field in a table of Microsoft SQL Server 2005 database.I am using SqlBulkCopy::WriteToServer api to write to SQL database.The data type of the column in Sql database table is of type varchar2. If I change the datatype to nvarchar the chinese...
4 Apr 2011 by Prerak Patel
No, nvarchar supports Unicode, while varchar doesn't.You have to use nvarchar only for chinese character support.
22 Mar 2011 by grander22
please help me. can someone teach me on what are the codes and where to put them if i where to use mysql as my database, adodb as my codes and vb6 for the interface? or can someone give me a sample project?
10 Apr 2009 by Saiyed Alam
Hello Can any 1 tell me how can I show column as row using query? Thanking in Advance Johnny
10 Apr 2009 by Luc 648011
Google for SQL PIVOT
1 Oct 2008 by swjam
Hi,I just wanted to know the term I am looking for what it is called so I can research further.Say I have an C# application that connects to an SQL server located somewhere in a network via connection string. What is the communication...
1 Oct 2008 by Mycroft Holmes
You are referring to a Data Access Layer (DAL), there are many different styles and types of DAL including a pattern from Microsoft. I usually create a standard SQL ID (userid and password) for each application (database), this allows you to...
25 Aug 2010 by Vinayaka Krishna Shenoy
Hi,Good interesting question, The answer again lies how client/Server communication happens?, when you want to communicate to SQL server by default it listens on tcp/ip port 1433...and if you configure your sql server for allow remote connections....then the client can communicate to the sql...
20 Mar 2007 by Jeremy T. Fuller
A simple method that compacts and repairs a Microsoft Access database file using the Microsoft Jet library and C# COM interop. The example code is meant to be integrated into an ASP.NET web site.
3 Apr 2015 by Member 11579826
Hi,I'm refactoring a VB6 based application that compared if two Micorosft Access (.mdb) files were the same into C#. In the old vb6 code, a hex key was developed after reading each file and I believe the comparison between the hex keys. The vb code would iterate through each database using...
3 Apr 2015 by Richard MacCutchan
Lots of ADO.NET samples to be found: https://www.google.com/search?q=ADO.net+with+C%23[^].
4 Apr 2015 by Maciej Los
I'd suggest to read this: Basic tasks in Database Compare[^] and this: How to: Compare Database Schemas[^]
3 Feb 2019 by Thinira
Continuous Integration and Delivery with VSTS (Visual Studio Team Services)
10 Feb 2015 by AlwaysLearningNewStuff
I have a query that gets the value of the payed amount of money. This field is currency type, in MS Access database.I need to display this value in textbox ( I am using C++ and raw WinAPI for GUI ), so I need to know how to convert _variant_ from recordset into proper string...
10 Feb 2015 by barneyman
Won't the currency type be mapped to something a little less stringy? i.e. an R8? examine the Value->dblVal componentAs far as formatting it correctly, you have 4 locale items to determine (if you want to do it 'right')1. currency symbol (LOCALE_SCURRENCY)2. grouping...
10 Feb 2015 by Jochen Arndt
Currency values are stored as type CURRENCY in the cyVal member of the VARIANT[^] with variant type VT_CY. From the above link:Quote:A currency number is stored as 64-bit (8-byte), two's complement integer, scaled by 10,000 to give a fixed-point number with 15 digits to the left of the decimal...
17 May 2017 by Maciej Los
This is an alternative for "Copy Rows Within Excel Sheets via VBA"
8 Sep 2023 by Member 14168791
After days of searching and trying different solutions, I give up and hope that someone can help me. I have an Access 2007 database named DB2023.accdb with several tables. I created with ADOX a new empty database named DB2024.accdb. Both are...
8 Sep 2023 by OriginalGriff
The simplest way is to copy the entire database as a file, then connect to it and delete all the information. That way, you also copy any stored procedures, functions, triggers, and so on as well as the table format.
8 Sep 2023 by Dave Kreskowiak
Just keep a blank copy of the database file with your app, either in the file system or in your app resources, and just make a copy every time you need a new database.
20 Mar 2009 by Mostafa Kaisoun
ActiveX to display invoice in grid and edit it, print invoices as Data Report using VB6
6 May 2009 by Mostafa Kaisoun
Create a new Table and re-create Table to set existent Field as Primary Key
17 Mar 2012 by steveRRRRRRR
Hi I have a VB6 app running off a secured MS Access Database.Currently - I have a number of reports created using an ADO datasource, and then from VB - I re-create the ado recordset (to link to the correct location of the db files). Set Report = Appl.OpenReport(gsDBPath & "\" &...
29 Jun 2018 by Member 13798855
hi all, i have implemented vb functionality in c++ i have replace below logic in c++ but it is giving issue : vb code: For Each loTDef In aoDBUser.TableDefs Set loProp = Nothing On Error Resume Next Set loProp = loTDef.Properties("Description") ...
12 Aug 2014 by Gihan Liyanage
Simple Dapper.NET Example with MVC
30 Jun 2012 by Mohammed Abdul Muqeet
it is not inserting the data where i am doing the mistak... , its showing catch error message string Patient_name = NameTxtBx.Text, Export_TO = ToTxtBx0.Text, repType = RadioButtonList2.SelectedValue ; int PatNoVal; ...
30 Jun 2012 by Sandeep Mewara
Is it even compiling?For instance, this line: SqlCommand cmd = new SqlCommand;
30 Jun 2012 by OriginalGriff
We can't tell for the same reason you can't: Your code hides the error.Change the catch block:catch (Exception ex) { Message("Block 3: Error\nThe Reported fault is:\n" + ex.Message, this); }That way, if the error message does not give you enough information, you can put a break...
6 Dec 2011 by sainivip
I want to know whole working of datasets, how they maintain data. Because if we work with dataset .Then we works in disconnect mode suppose that we pick some data in data set and get disconnected from db. and made some calculateion based upon disconnect data and perform save opration.But in...
27 Sep 2005 by Eunge
DataQuicker takes the transparent level, speeds up your application building and reduces the coupling between application and database. It supports convertion from table/view to DAL directly with accessional tools. It can nearly cut off all your efforts on DAL design and coding...
8 Jul 2012 by saqib.akhter
Hello,I got a problem to execute a date validation query for MS access database under ADO VC++ programming (VC6.0).I am using the below mentioned query for date validation but it's giving mismatch date format error message because date format in MS Access Database is "DD-MM-YYYY...
8 Jul 2012 by Mohibur Rashid
I think you can change the format according to ISO standard. and for control DateTime_SetFormat macro is used for c/c++. try it out see if you can set your format
8 Jul 2012 by Jochen Arndt
You should use the english date format 'mm/dd/yyyy' and enclose the date specifications by hash characters. With ranges, use the BETWEEN operator and include the times:SELECT * from Customer WHERE RegDateTime BETWEEN #02/15/2012 00:00:00# AND #02/25/2012 23:59:59#If you want to limit...
9 Jul 2012 by armagedescu
What about format function?It would be something like thisSELECT * from Customer WHERE RegDateTime >= FORMAT('02/05/2012', "dd/mm/yyyy")....