Click here to Skip to main content
15,881,380 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 Score

ADO 

8 Sep 2017 by Daniele Fontani
.NET Core showcase: learn basics implementing a toy tool
24 Feb 2002 by Kirill Panov
CDataGrid which was derived from CGridCtrl and used ADO for access to database.
26 May 2013 by Tharaka MTR
This post will show you how to fix orphaned SQL users.
29 May 2017 by tranthanhtu.vn
In this article, We will learn why do we need to manage the stages of our application.
3 Feb 2019 by Thinira
Continuous Integration and Delivery with VSTS (Visual Studio Team Services)
4 Nov 2021 by #realJSOP
A tool to generate model and viewmodel classes directly from your selected database
3 Jul 2013 by Ohad Redlich
This article shows how Java application can retrieve user's data from the Active Directory
24 Jan 2022 by peterswinkels
A Visual Basic 6 program demonstrating how to access databases using Microsoft ADO and how to automate Outlook and Excel.
8 Jul 2018 by Alen Toma
How to implement ObjectStatus with EntityWorker.Core and JavaScript
17 Dec 2007 by alex turner
Excel 2007 does not seem to support DBF files, here is a VBScript workaround.
28 Aug 2008 by Robert Kirchhof
Provide the OU, and set or clear the checkbox on all managed groups within it
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 Jan 2011 by thatraja
You have already asked the same question here.Previous same question - Get list of all tables from database[^]Also It has answer. But also I have asked about which database by comment[^].Then you should have told about database to the answerer or me else in your question. But you...
28 Jun 2012 by nv3
You should put a where-clause in your SQL statement, like ... WHERE B.name = A.name ...to select only those tuples from the cartesian product that match regarding the key that links the tables logically.
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...
3 Aug 2011 by Eric Lynch
Flexible CSV reader/writer with progress reporting and many file format variations.
29 Oct 2001 by simulant
Transform any XML persisted ADO Recordset into a delimited text file.
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,...
24 Oct 2008 by Syed Mehroz Alam
ScruffR wrote:Is there something like "r = MaximumOf(MinimumOf(x,maxX),minX)" - or even better "r = ClipToBoundaries(x,minX,maxX)"?How about creating an scalar-valued function ClipToBoundaries? Regards,Syed Mehroz Alam My BlogMy Articles
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...
4 Jun 2010 by DaveAuld
What your talking about is the database schema, and obtaining it.see this article for some pointers;http://aspalliance.com/542[^]
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...
3 Feb 2012 by thatraja
http://www.connectionstrings.com/[^]
5 Apr 2012 by OriginalGriff
You need to look at your code: the trace is pretty explicit - look at the CSharp.aspx.cs file, at line 17.Somewhere, on that line of code you are either trying to use a null value as a class instance (as in myClassVaraible.MyProperty with myClassVariable not set to a new value), or you are...
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...
29 Aug 2013 by André Kraak
The edit controls and MS Access are working correctly.They are using the decimal as defined in the Regional and Language Options as you have noticed.The problem is the use of the _wtof[^] function.The documentation states: Quote:The versions of these functions with the _l suffix are...
2 Feb 2014 by Sergey Alexandrovich Kryukov
I don't see where did you try to set the locale. Perhaps you don't really need to respond to the change of locale. You can apply the locate you need to the current thread. To related functions...
2 Feb 2014 by Jochen Arndt
From within your WM_SETTINGCHANGE handler you are calling _wsetlocale( LC_ALL, L"" );This will set the locale to the default, which is the user-default ANSI code page obtained from the operating system, but not the current LCID when it has been changed in the control panel.To set the...
20 Jun 2016 by OriginalGriff
Under normal circumstances, it shouldn't matter - because it's a very good idea to use a Using block around the creation of the instance anyway:Using con As New SqlConnection(Acc.Common.Configuration.Instance.ConnectionString) con.Open() Using com As New SqlCommand("SELECT iD, description...
1 Dec 2019 by Fedor Dzjuba
Sometimes, we need to present MDX result on the web or a client application that has no native provider to Microsoft Analysis Service. Solution is to use Adodm.Client CellSet, serialize it into sensible JSON and spit it out to the client to render.
13 Jul 2023 by Graeme_Grant
You wire it up here: if (onChangeEventHandler != null) { var sqlDependency = new SqlDependency(sqlCommand); sqlDependency.OnChange += onChangeEventHandler; } The issue I think is scope. The scope only exists in the if statement.
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.
10 Jul 2008 by Ashfield
I doubt it. Its not the fast thing around. BTW, with the code shown, you do realise you are locking most of the system tables in your tempdb database for the 7-8 minutes it takes to run. A select into locks system tables for the duration of its...
16 Jul 2008 by fracalifa
Hi all,I want to fill a grid (no hirarchical) where to combine customer data and the last selling item of each customer in a row (getting only the last sellings depending on sells_date).My idea was SELECT C.id,C.customerdata,S.id,S.sellsdata FROM...
16 Jul 2008 by leoinfo
You should ALWAYS provide the actual fields for each table to avoid misunderstandings.This should solve the problem...;WITH LatestSells AS ( SELECT s1.* FROM dbo.Sells AS s1 INNER JOIN ( SELECT DISTINCT Customer_ID , ( SELECT TOP 1 Sell_ID...
21 Jul 2008 by gethomast
I have problems on quering or better numerating all items from a specified table.Here are my tables (Third normal form):MailTable: Id, Created, SubjectAddressTable: Id, NameSenderTable: MailTableId, AddressTableIdRecipientTable: MailTableId,...
22 Jul 2008 by leoinfo
( You are using SQL2005, right? )Try this:;WITH RecipientsByMail (MailId, RecipientList) AS ( select mx.Id AS MailId , ( select AddressTable.Name+',' from MailTable join RecipientTable on...
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...
24 Oct 2008 by ScruffR
Is there an easy way to restrict values - returned by a SQL select - to certain boundaries?I've got a some tables like thisdataTBL:dt id x2008-01-01 10:00 1 5.132008-01-01 10:00 2 14.002008-01-01 10:00 3 ...
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("'",...
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
15 Jun 2009 by LTMKH
when i want to Clear my record in SQL server 2005 i used this code:USE [Test]GODELETE FROM TblAuditTrial;DELETE FROM TblAuditTrialGroup;DELETE FROM TblGrossProfitDELETE FROM TblMenuDELETE FROM TblMenuCategoryDELETE FROM TblMenuSubCategoryDELETE...
15 Jun 2009 by Isaac Gordon
use this select distinct 'delete from '+ Table_Name from information_Schema.columnsorEXEC sp_MSForEachTable 'DELETE FROM ?'EXEC sp_MSForEachTable 'TRUNCATE TABLE ?'
18 Jun 2009 by David Mujica
I see two closing parenthesis )) and only 1 open parenthesis. (
18 Jun 2009 by Luc Pattyn
Hi,... WHERE NOT (Active = 0) might work for both database systems. Luc Pattyn [Forum Guidelines] [My Articles]DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at...
26 Oct 2009 by dougturn
An overview of the Microsoft interoperability story for Open Source community and PHP Developers.
29 Nov 2009 by AspDotNetDev
Have you tried:UPDATE TableName SET Result = 2 ^ 2
29 Nov 2009 by AspDotNetDev
So, what you really want to do is call VBA functions from MS Access queries? This page explains how to do that.
29 Nov 2009 by AspDotNetDev
I don't really follow you. If you want to use a VBA function in an Access query, just create your own UDF that wraps that VBA function, then you can use that UDF in your Access query. And if you want to use some Access query function from VC++, you can make database calls to an Access DB from...
3 Jan 2010 by Christian Graus
This is not a question, it's a show of ignorance. ADO has nothing to do with any sort of form, it's how databases used to work before .NET. So, try asking a real question, preferably one that shows you're likely to understand the answer. This post just makes me think that you have not the...
3 Jan 2010 by DABBee
You ask a question that is impossible to answer.Your ADO tag only confuses the question.If you are looking for someone to write your code this is unlikely to result in any useful answers.I would suggest you look for examples via Google or Yahoo once you properly format the question...
3 Apr 2010 by Mycroft Holmes
tiancehngbo wrote:I searched on the internet,Thats pathetic, this is the most basic step in developing an application and has been solved by EVERY developer that ever used a database.Go to connectionstrings.com, they are n excellent resource for this.
13 Apr 2010 by Gregory Gadow
If I understand your question correctly, I would do it like this:Public Function GetDirectoryEntry(ByVal Path As String) As DirectoryEntry Dim Result As DirectoryEntry = Nothing Try Result = New DirectoryEntry(Path) Dim Test As System.Guid = Result.Guid Catch...
2 Mar 2011 by PJ Arends
I have connected to my SQL Server 2005 database by using ADO (through A set of ADO classes - version 2.20 by Carlos Antollini). Now I have set the connection mode to be ReadOnlyCADODatabase *pDatabase = NULL;pDatabase = new...
9 Jun 2011 by Monjurul Habib
http://www.oracle.com/technetwork/topics/dotnet/index-085703.html[^]http://blogs.msdn.com/b/kaevans/archive/2009/07/18/connecting-to-oracle-from-visual-studio.aspx[^]http://msdn.microsoft.com/en-us/library/system.data.oracleclient.aspx[^]
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 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...
17 Dec 2012 by Vishal.Shimpi144
int count = grvTest.Rows.Count; foreach (GridViewRow row in grvTest.Rows) { string text = row.Cells[0].Text; }so that you can get the cell value of 1st column of your grid view
4 Feb 2013 by spostad7
I know the useful component that simplify chat conversation operation in asp.net. just google "MangoChat". It's free and u can use it in every asp.net pages. Also it has very useful guideline document that u can use it for helpjust try it one time! u will love it ;)
12 Feb 2013 by Sandeep Mewara
It does not work like this here.Here is what is expected of enquirers:1. TRY first what you want to do! You may find that it's not that hard.2. Formulate what was done by you that looks like an issue/not working. Try them and tell if you face issues.Members will be more than happy...
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...
21 Jun 2013 by Bilashcse
This article will be helpful for you. Link : http://www.cprogramming.com/tutorial/c++_database_access_using_ado.html[^]
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:
7 Aug 2013 by MyOldAccount
I have the query like bellow, and it works: SELECT County ,sum( switch( ТGTE = 'L', 1, TGTE = 'H', 0 ) ) as [L_Count] ,sum( switch( ТGTE = 'H', 1, TGTE = 'L', 0 ) ) as [H_Count] FROM MyTable GROUP BY County;Everything works fine, when I...
9 Aug 2013 by MyOldAccount
With the help of better developers than me, and Internet I was able to solve it using this query:SELECT IIF(TypeOfObject in('Type1', 'Type2'), TypeOfObject, 'OtherTypes') as TypeOfObject , SUM( InstaledPower ) as [SUM(InstaledPower)] FROM MyTablegroup by ...
10 Aug 2013 by Maciej Los
Alternative ways:1) using UNION[^] statement:DECLARE @tmp TABLE (TypeOfObject VARCHAR(30), InstaledPower INT)INSERT INTO @tmp (TypeOfObject, InstaledPower)SELECT 'Type1', 1000UNION ALL SELECT 'Type2', 2000UNION ALL SELECT 'Type3', 450UNION ALL SELECT 'Type4', 800UNION ALL...
11 Aug 2013 by Gauri Chodanker
Another solution for the same resultSELECTCASE WHEN TYPEOFOBJECT NOT IN ('TYPE1','TYPE2') THEN 'OTHERS' ELSE TYPEOFOBJECT END TYPEOFOBJECT, SUM(INSTALLEDPOWER) INSTALLEDPOWERFROM T_POWERGROUP BY CASE WHEN TYPEOFOBJECT NOT IN ('TYPE1','TYPE2') THEN 'OTHERS' ELSE...
29 Aug 2013 by H.Brydon
I like Andre's solution (and I gave +5 for it too). An alternative thing you can do (and you probably need to do if you are dealing with multiple versions of the stored data) is get the string from the database, and replace all "," with "." in the string before converting to double.
1 Sep 2013 by pasztorpisti
You can not close/terminate a thread especially if it contains blocking function calls. You have to send a signal to the thread and then you have to wait for it to exit gracefully. You can not finish/kill a thread properly from another thread without causing possibly serious damage to the...
18 Dec 2013 by Maciej Los
Please, read my comment to the question first.If you want to execute SQL command to create table, you need to grant PERMISSIONS[^] to the current user.Personally, i would not recommend to allow users to create unknown number of tables. Who will be able to manage them?[EDIT]You...
18 Dec 2013 by Jashobanta
DO NOT DO IT IN THIS WAY.Try creating a stored proc that can do this. Create the below stored procedure in your sql and do all the validations from your end on the same in the proc.create proc createTable(@tableName varchar(30),@column1 varchar(30),@column1DataType...
18 Jan 2014 by Petr Ivankov
Application of abstract approach to database domain
2 Feb 2014 by chaau
Easy. You need to convert the text to double and then insert it in the database. You have not specify what you are using for data insert, so I assume you build the INSERT query dynamically, like this (assuming you are using MFC):CString text1, text2, sql;GetDialogItemText(IDC_EDIT1,...
9 Feb 2014 by Abhinav S
LINQ and ADO.Net are very different things.ADO.Net provides the core framework for database connectivity.LINQ is a coding technique to help you write "shortcut" code to achieve tasks for e.g. quickly search through a list of numbers using Select() or Where() etc.Some basic books on...
11 Apr 2014 by cigwork
If you only need the ordinal field for reports/display would a query with a calculated field be a possible solution?I haven't got a copy of Access to hand, but the T-SQL for this approach would be as shown below. Where I've created a view you'd create your Access query and use that instead...
15 Sep 2014 by George Jonsson
Change the method GetConnection to this.Remove the variable declaration of SqlConnection inside the method.public class myConnection{ // This construct auto creates a property. // You can use this in your code as a regular property // private set means that you can only...
19 Nov 2014 by JJMatthews
I just did this in a project myself. What I had to do was Create the DB field as an "OLE Object" (field type). To read/write the field I used a SafeArray packed in a COleVariant (vt = VT_ARRAY | VT_UI1). Heres some example code:// ADO - 2.7 comes with WinXP#import "msado27.tlb"...
23 Jan 2015 by Wendelius
Not sure if I understood your question correctly, but why not store the database location in a simple configuration (text) file in the same folder where the application is.The first time the application runs, let the user specify the database location with a File Open dialog and store the...
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.
4 Aug 2016 by Vincent Maverick Durano
The error is pretty much self-explanatory. This means that you cannot cast the SelectedValue to a DataRow because the SelectedValue will return an integer. Also If you want to get the SelectedRow, you might want to handle it at SelectedIndexChanged event. But keep in mind that in order to...
1 Jun 2020 by OriginalGriff
You don't use a DataReader with an SQL UPDATE command - only with queries that contain a SELECT statement. Instead, use ExecuteNonQuery: Dim query1 As String = " Update verfication SET device = device - 1 WHERE serial=@serial" ...
17 Apr 2022 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.
13 Jul 2022 by Graeme_Grant
Simply use an ObservableCollection as the ItemSource. The DataGrid them becomes the "View" into the data. Now simply removing items from the ObservableCollection will be reflected in the DataGrid.` Here is a simple example: 1. Class to hold a...
18 Jul 2022 by CHill60
Have a look at the demo code at SqlBulkCopyColumnMapping.DestinationColumn Property (System.Data.SqlClient) | Microsoft Docs[^] In particular note the comment against their example Quote: Although the number of columns in the destination matches...
9 Nov 2022 by OriginalGriff
It's not telement, it's TElement: it's a type placeholder that makes the method work with multiple types without you having to code for all of them separately. Generic classes and methods | Microsoft Learn[^] Get used to them, they are a very...
11 Jan 2023 by CHill60
There are several issues with your code, the connection string does not seem to be one of them. 1. You are opening a connection to your database and attempting execute some SQL - but you have not defined where the results should go 2. You are...
5 Feb 2023 by Andre Oosthuizen
As per Microsoft's tutorial found HERE, you can do the following to import a database from Sql Server into Access - NOTE: When you import data, Access creates a one-time, copy of the data, and so any changes made to data after the import in...
7 Jan 2008 by Visual Numerics, Inc.
This document focuses on the combination of VSTO 2005 and Visual Studio 2005 Team Edition.
1 Dec 2009 by lazydie
When I use SQL in VC++ to operate an Access tables, functions such as sin(), are OK!The code:"Update tablename set Result=POWER(2,2)" IS wrong!DEBUG: m_pszMsg 0x001774b0 "IDispatch error #3092" m_strErrorDescription "Express 'power' Function undefined" Is...
29 Nov 2009 by lazydie
Thanks to "aspdotnetdev"2^2 is OK.But how about LN()?It still doesn't work.And other functions?The core of my question is "How to use functions embeded(inner?) Access 2003 such as "POWER(),LN()",while using VC++ to operate Access DataBase?" I have check some chinese sites,as if there is...
29 Nov 2009 by lazydie
After having read for a long time,I don't know how to use VBA in my VC++ program! Will you plea tell me how to do it?Sorry for my much questions!Thanks to "aspdotnetdev" Again. :-D
29 Nov 2009 by lazydie
After "aspdotnetdev"'s telling. I get to know that,there is no way for my original question.One must writes his own code to get the functions in VC++ after querying from access table the values of some fields. Good Luck! "aspdotnetdev"!yours sincerly.
30 Nov 2009 by lazydie
Finally,I find that the functions used while using VC++ to operate Access DataBase with ADO are the same in ASP.And all the elementary mathmatics functions can be used.(For example:power()->"^";ln()->"log()")Thanks!!!
30 Dec 2009 by Nirav kukadiya
hi!!!! i m niv give me answer of this qustion
4 Jan 2010 by chelle
I have a problem here, i'm trying to create a asp page where my recordset have a link to a id present in the DB which can be brought to my other page which will delete the record base on the IDEG::AL(id=1)OIL(id=2)when the user click on AL, the page can capture the value 1 search...