Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Search the Tips
Tip Bank > Visual Basic > ADO and ADO.NET

ADO and ADO.NET - Page 4

61-80 of 117     Previous     Next
MTS Objects Containing ADO
by DevX Pro
I have an MTS object that contains an ADO connection object which I use in an ASP page. I look at the MTS console and confirm that the package gets activated, and I use ODBC performance-monitoring counters to verifty a connection gets pooled. But when I manually shutdown the component or let it idle timeout, I notice the connection gets closed also. Shouldn't the ADO connection object stay around after the MTS component gets destroyed, since the ODBC idle connection time is higher than the component idle time?
Determine the RecordCount of a forward-only Recordset
by Francesco Balena
When working with a forward-only, read-only Recordset - that is, the default ADO Recordset - the RecordCount property always returns -1. (This can also happen with other types of server-side cursors, depending on the specific OLEDB provider.) In general, you can determine how many records were ...
Open a password-protected MDB database with ADO
by Francesco Balena
The syntax for opening a password-protected Jet database might not be obvious. In fact, assigning the password to the Password property in the ConnectionString raises the following error: Run-time Error: 2147217843 (80040e4d) Cannot start your application. The workgroup information ...
Use aliased field names to avoid ambiguities in JOIN commands
by Francesco Martire
Suppose you have two tables named Table1 and Table2 with one or more fields named the same way. Now, consider this query: rs.Open "SELECT * FROM table1 INNER JOIN table2 ON table1.id = table2.id" In our example, both table1 and table2 share the same field name "field1", but ...
Save Data in a SQL Server Image Column with VB6
by Gian Maria
I needed to retrieve image fields on SQL Server 7.0 with VB6, and I couldn't find any article about it. So, I assume others have had the same problem. I've since found a method for doing it.
Build an XML Document for a Recordset on the Fly
by Venkat Alladi
(Note: This tip assumes that you have an ...
RecordCount Property-ADO
by DevX Pro
How do I get the rowseffected from the execute method of an ADO command object? The code I've written is: Dim Cn as New ADODB.Connection Dim Cmd as New ADODB.Command Dim Recordset as New ADODB.Recordset Dim lintRecEffected As Integer Cn.Open "some connection string" Cmd.ActiveConnection =Cn Cmd.CommandType=adCmdStoredProc Cmd.CommandText = "SelecRecords: Set Rs=lcmd.ExecutelintRecEffected) msgbox lintreceffected This shows -1 even though the record is inserted. By the way, my backend is db2.
Dealing with Multi-Recordsets Returned by Compound SQL Statements
by Ning Hao
Everyone can deal with one recordset easily. However, if a SQL statement is like this: "SELECT a, b FROM Table1 COMPUTER SUM(a), SUM(b)," looping though the recordset will not return the aggregate ...
The hidden Collect method of the Recordset object
by Francesco Balena
The ADO Recorset object exposes a hidden, undocumented member: the Collect property. This property is functionally similar to the Field's Value property, but it's faster because it doesn't need a reference (explicit or implicit) to the Field object. You can use this property by passing a ...
Use ADO "Prompt" Property to Allow the User to Initialize the Provider
by Jai Bardhan
Prompt is a dynamic property that OLE DB providers can use to allow the user to input customized initialization information, typically through a dialog box. The OLE DB provider may append this ...
Counting the Number of Records in
a Recordset
by Jai Bardhan
Editor's Note: This tip is an update to a previous Tip of the Day. Jai Bardhan claims to have a "better ...
Export to a text file with quoted fields
by Francesco Balena
As explained in another item in this Tip Bank, you can use the Recordset's GetString method to export a Recordset to a comma-delimited or tab-delimited text file. However, if you are exporting string fields that might include commas or tabs, you should include the fields' value within quotes. ...
Export to a text file with the GetString method
by Francesco Balena
The GetString method of the Recordset object returns a formatted string that contains all the values in each field and each row in the recordset, with your choice of column and row delimited. You can therefore use it to quickly and easily export the recordset to a comma-delimited text file, for ...
Faster client-side ADO 2.1 Recordset with the OPTMIZE dynamic property
by Francesco Balena
ADO 2.1 added a new, important dynamic property to the Field object, the OPTIMIZE property. If you have a client-side Recordset and you set this property to True, ADO will create an Index for the specified field, and will then automaticaly use that index for any Find, Sort, and Filter ...
Adding a New Record to ADO
by DevX Pro
I know there are two ways to insert a new record. One way is to execute a Insert statement, the other way is use the recordset.AddNew method. In terms of performance, which one is better? When dealing with the memo field, which may contain single quotes or double quotes, is AddNew method the only way to go?
Searching with Multiple Fields
by DevX Pro
I am developing a s/w with an Access database, using ADO. Now, I want to search a table with multiple columns. As in find method (ADO), it allows only one column to search. How do I search a record with a multiple column search?
Create explicit Field objects when looping on large Recordsets
by Francesco Balena
Whenever you access a database field through the Recordset object you incur in a slight overhead. Take for example the following code snippet: Dim rs As New ADODB.Recordset rs.Open "SELECT au_lname, au_fname FROM authors", "DSN=pubs", , , adCmdText Do Until rs.EOF List1.
ADO Events
by DevX Pro
How do I use the ADO events FetchProgress or FetchComplete?
ADO Connection String
by DevX Pro
What is the syntax for accessing a FoxPro 2.5 table using an ADO connectionstring? I want to be able use a DSN-less connection and access different tables depending on the user request.
Take Advantage of ADO Optimizations
by Jai Bardhan
A common user scenario in a development environment is where the code typically opens a connection, executes a row or non-row returning command, processes results, and closes the connection. For such ...
61-80 of 117     Previous     Next
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date