Microsoft KB Archive/170381: Difference between revisions
m (Text replacement - ">" to ">") |
m (Text replacement - """ to """) |
||
Line 12: | Line 12: | ||
<div id="TitleRow"> | <div id="TitleRow"> | ||
= <span id="KB170381"></span>PRB: Table Name Can't Include | = <span id="KB170381"></span>PRB: Table Name Can't Include "Call" in Parameterized SQL = | ||
Line 44: | Line 44: | ||
== SYMPTOMS == | == SYMPTOMS == | ||
When you use CreateQuery to execute a parameterized action query to insert or update records in SQL Server, if the SQL Statement involves a table whose name includes the Keyword | When you use CreateQuery to execute a parameterized action query to insert or update records in SQL Server, if the SQL Statement involves a table whose name includes the Keyword "Call," the following error will be displayed: | ||
<div class="errormessage"> | <div class="errormessage"> | ||
"Run-time error '40041':<br /> | |||
object collection: Couldn't find item indicated by text | object collection: Couldn't find item indicated by text" | ||
</div> | </div> | ||
Line 57: | Line 57: | ||
== RESOLUTION == | == RESOLUTION == | ||
Change the Table Name to something else that does not have the word | Change the Table Name to something else that does not have the word "Call" in it. For example, changing the Table Name "TestCallTable" to "TestCalTable" solves the problem. | ||
</div> | </div> | ||
Line 90: | Line 90: | ||
<div class="errormessage"> | <div class="errormessage"> | ||
"This command did not return data, and it did not return any rows" | |||
</div> | </div> | ||
Line 113: | Line 113: | ||
Set en = rdoEngine.rdoEnvironments(0) | Set en = rdoEngine.rdoEnvironments(0) | ||
With cn | With cn | ||
.Connect = | .Connect = "uid=<username>;pwd=<strong pasword>;database=Pubs;dsn=Jtest;" | ||
.CursorDriver = rdUseClientBatch | .CursorDriver = rdUseClientBatch | ||
.EstablishConnection Prompt:=rdDriverNoPrompt | .EstablishConnection Prompt:=rdDriverNoPrompt | ||
Line 119: | Line 119: | ||
Set Qd.ActiveConnection = cn | Set Qd.ActiveConnection = cn | ||
With Qd | With Qd | ||
.SQL = | .SQL = "Insert into TestCallTable Values(?,?,?)" | ||
.rdoParameters(0) = 1 | .rdoParameters(0) = 1 | ||
.rdoParameters(1) = | .rdoParameters(1) = "A" | ||
.rdoParameters(2) = | .rdoParameters(2) = "A Test" | ||
.Execute | .Execute | ||
End With | End With |
Latest revision as of 11:05, 21 July 2020
Article ID: 170381
Article Last Modified on 11/3/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Enterprise Edition
This article was previously published under Q170381
SYMPTOMS
When you use CreateQuery to execute a parameterized action query to insert or update records in SQL Server, if the SQL Statement involves a table whose name includes the Keyword "Call," the following error will be displayed:
RESOLUTION
Change the Table Name to something else that does not have the word "Call" in it. For example, changing the Table Name "TestCallTable" to "TestCalTable" solves the problem.
STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
Create the Table in SQL Server:
- Open the SQL Server 6.5 ISQL utility and change the default database to Pubs.
Paste the following code into the Query window and click the Execute Query button, or press CTRL+E to execute the Transact-SQL code:
CREATE TABLE dbo.TestCallTable ( F1 int NOT NULL CONSTRAINT UPKCL_F1ind PRIMARY KEY CLUSTERED, F2 varchar (4) NULL , F3 varchar (8) NULL ) GO
- The following confirmation message appears: which indicates that the Transact-SQL code created the stored procedure correctly.
Create the Visual Basic Code:
- Start a new Standard EXE project in Visual Basic 5.0. Form1 is created by default.
- Under the Project\References menu, Select Microsoft Remote Data Object 2.0.
- Add a CommandButton (Command1) to Form1.
Insert the following code into the Click event of Command1.
Note You must change the following connection string parameters to reflect the correct values for the computer that is running SQL Server.Private Sub Command1_Click() Dim en As rdoEnvironment Dim cn As New rdoConnection Dim Qd As New rdoQuery Set en = rdoEngine.rdoEnvironments(0) With cn .Connect = "uid=<username>;pwd=<strong pasword>;database=Pubs;dsn=Jtest;" .CursorDriver = rdUseClientBatch .EstablishConnection Prompt:=rdDriverNoPrompt End With Set Qd.ActiveConnection = cn With Qd .SQL = "Insert into TestCallTable Values(?,?,?)" .rdoParameters(0) = 1 .rdoParameters(1) = "A" .rdoParameters(2) = "A Test" .Execute End With End Sub
- Press the F5 key to run the program.
Click on Command1. You will receive 'error 40041: object couldn't find item indicated by text.' on following line of code:
.rdoParameters(0) = 1
Keywords: kberrmsg kbprb KB170381