Microsoft KB Archive/248502: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 45: Line 45:


When your code calls the setRecordSource() method of the Visual InterDev 6.0 Recordset design-time control (DTC) and passes to it a valid connection string and SQL statement, the changes do not take effect. Here is an example:
When your code calls the setRecordSource() method of the Visual InterDev 6.0 Recordset design-time control (DTC) and passes to it a valid connection string and SQL statement, the changes do not take effect. Here is an example:
<pre class="codesample">RSDTC.setRecordSource &quot;DRIVER=SQL Server;SERVER=Server1;UID=sa;DATABASE=Pubs&quot;, &quot;Select * from authors&quot;
<pre class="codesample">RSDTC.setRecordSource "DRIVER=SQL Server;SERVER=Server1;UID=sa;DATABASE=Pubs", "Select * from authors"
                 </pre>
                 </pre>



Latest revision as of 12:50, 21 July 2020

Knowledge Base


BUG: setRecordSource() Fails When Passed a Connection String and SQL Statement

Article ID: 248502

Article Last Modified on 10/16/2002



APPLIES TO

  • Microsoft Visual InterDev 6.0 Standard Edition



This article was previously published under Q248502

SYMPTOMS

When your code calls the setRecordSource() method of the Visual InterDev 6.0 Recordset design-time control (DTC) and passes to it a valid connection string and SQL statement, the changes do not take effect. Here is an example:

RSDTC.setRecordSource "DRIVER=SQL Server;SERVER=Server1;UID=sa;DATABASE=Pubs", "Select * from authors"
                

CAUSE

This fails because of a bug in the script library for the Recordset DTC (Recordset.asp).

RESOLUTION

To resolve the problem, replace the single setRecordSource() call with two calls: one to getRecordSource(), in which you set the ActiveCommand.ActiveConnection property of the underlying ADO Recordset, and a second call, to setSQLText(), in which you set the source SQL statement. For example, replace

RSDTC.setRecordSource strConnectionString, strSQL
                

with:

RSDTC.getRecordSource().ActiveCommand.ActiveConnection = strConnectionString
RSDTC.setSQLText strSQL 
                

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Keywords: kbbug KB248502