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 January, 2011

PRB: Instantiating Object in .exe Starts Another .exe Instance

Symptoms
When you instantiate a COM component in an out-of-process server (.exe)from Active Server Pages (ASP), another instance of the .exe starts.
Resolution
The default Identity of a COM component in an .exe is the Launching User.The implication of this is that when the Active Server Pages page tries tocreate an instance of this object, it is doing so in the security contextof the anonymous user (IUSR_<machine name>). If this is a different userfrom the user that started the instance of the .exe that is currentlyrunning, another instance of the .exe starts.

PRB: Paradox ISAM Does Not Support Some Paradox 4.x Types

Symptoms
Microsoft Jet versions 3.51 and 4.0 provide a Paradox ISAM driver that allows access to Paradox 4.x tables. However, the Paradox ISAM driver does not support the BINARY BLOB (type B) Paradox 4.x data type. Thus, fields that use this data type will not be available in Visual Basic.
Resolution
This behavior is by design.

PRB: Opening an ODBC Database Inside a Jet Workspace Hangs VB

Symptoms
Attempting to use a Jet workspace to open an ODBC datasource based on a Jetdatabase can cause Visual Basic to hang. This is essentially causing Jet totalk to itself. This is not a supported way of accessing an Access/Jetdatabase.
Resolution
You can use an ODBC workspace to open an ODBC datasource based on a Jetdatabase. You can also open a Jet database directly, without an using anODBC datasource.

PRB: ODBCDirect Cursor Not Valid After Transaction Commits

Symptoms
When you use ODBCDirect with Visual Basic, you receive the following error on accessing a recordset object that was created inside of a transaction that has been committed or rolled back:

3670 Cursor is not valid
Resolution
This error occurs because you are using server-side cursors on your connection and the cursor is being closed when the transaction is committed or rolled back. Whether a server-side cursor is closed on a transaction commit or rollback depends on the database driver that you are using. For the SQL Server driver, the default is to close the server-side cursor on the commit or rollback of a transaction.

PRB: Jet Doesn’t Support QueryDefs on a Non-Attached ODBC Table

Symptoms
Jet does not support named QueryDefs on a non-attached ODBC database. A nonattached ODBC database is one that is opened directly with theOpenDatabase method of the WorkSpace object without the use of an .mdb file.
Resolution
The preferred method for opening an external ODBC table is to attach it toan .mdb file. For additional information, please see the followingarticle(s) in the Microsoft Knowledge Base:
150716?(http://support.microsoft.com/kb/150716/EN-US/): DAO: How To Attach to and Create QueryDefs on ODBC Tables
If this method is not appropriate for your application, the followingexample shows how to createQuerydefs with no name:

Set qd = db.CreateQueryDef(“”)qd.SQL = “Select * from authors”