Visual Basic Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries for March, 2011

PRB: Run-time Error Message 3024 Using SQL and DAO Against Oracle

Symptoms
If you try to run Structured Query Language (SQL) against an Oracledatabase through Data Access Objects (DAO), you can encounter the followingerror:

Run-Time Error 3024
Couldn’t find file C:\Program Files\DevStudio\VB\<schema name>.mdb.This error occurs when you try to specify a schema name in your SQLstatement and you use DAO with Oracle. The <schema name> in the errormessage is whatever schema name you specified for the Oracle object youreference.
Resolution
If you add the dbSQLPassThrough option to the OpenRecordset method, thesample code in the MORE INFORMATION section of this article runs withouterror. You can use brackets ([ ]) around the table name in the SQL string toavoid the error as well:

sql = “SELECT * FROM [scott.emp]” Also, you can use an advanced data access technology, such as ActiveX DataObjects (ADO) to avoid this error.

PRB: Run-Time Error 713 Opening Data Report in Distributed Application

Symptoms
You are distributing a Visual Basic application that includes a data report. After installation, you receive the following error when you attempt to open the data report from your application:

Run-time error ‘713′:Application-defined or object defined error
Resolution
The Data Report run-time file (Msdbrptr.dll) was not included in your setup package.

PRB: Retrieving very large XML Documents from SQL Server 2000 by using ReadText method of ADO stream object may be slow

Symptoms
Queries that result in a large amount of XML data being returned through the ReadText method of the ActiveX Data Object (ADO) Stream object may take a great deal of time to execute; if this is done in a COM+ component that is invoked from an ASP page, the user’s session may time out.
Resolution
ADO converts Stream object data from UTF-8 encoding to Unicode; the frequent memory reallocation involved in conversion of such a large quantity of data at once is quite time-consuming.