Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Problem with my Query... Please help.

Posted on 2004-04-05
2
Medium Priority
?
477 Views
Last Modified: 2012-06-27
I am using the following Query in Excel VBA:

QueryBOM = "SELECT [Silver King$BOM Component].[Parent Item No_]," & _
  "[Silver King$BOM Component].[LM Version Code]," & _
  "[Silver King$BOM Component].[Point of Use]," & _
  "[Silver King$BOM Component].[Balloon No_]," & _
  "[Silver King$BOM Component].[No_]," & _
  "[Silver King$BOM Component].[Description]," & _
  "[Silver King$BOM Component].[Quantity per]," & _
  "[Silver King$BOM Component].[Unit of Measure Code]," & _
  "[Silver King$BOM Component].[Type]," & _
  "[Silver King$Item].[No_]," & _
  "[Silver King$Item].[LM Current BOM Version]," & _
  "[Silver King$Item].[LM Item Status]," & _
  "[Silver King$Item].[Description]," & _
  "[Silver King$Item].[Revision Level]," & _
  "[Silver King$Item].[Replenishment System]," & _
  "[Silver King$Item].[Base Unit of Measure]" & _
  "FROM [Silver King$BOM Component],[Silver King$Item] " & _
  "WHERE [Silver King$BOM Component].[No_] = '" & PartNumberChild & "' " & _
  "AND [Silver King$BOM Component].[LM Version Code] = " & _
  "[Silver King$Item].[LM Current BOM Version] " & _
  "ORDER BY [Silver King$BOM Component].[Parent Item No_]," & _
  "[Silver King$BOM Component].[LM Version Code]," & _
  "[Silver King$BOM Component].[Point of Use]," & _
  "[Silver King$BOM Component].[Balloon No_]"

But I guess this error about it runs for about a minute:

Run-time error '-2147467259 (80004005)':
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (WrapperRead()).

In the past I queried one table at a time and then skipped past the data I didn't want, but in an attempt to reduce run-time I wanted to try a join (or adding a compare between fields in each table in the WHERE command).

Any help would be great!

Thanks
0
Comment
Question by:dougshepard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Accepted Solution

by:
arbert earned 1500 total points
ID: 10762349
To make things easier, I would paste the query into Query Analyzer and take a look at it.    See what the query plan looks like and see if Query Analyzer gives any errors.
0
 

Author Comment

by:dougshepard
ID: 10770828
Ahhh.  Query Analyzer is part of Enterprise Manager.  Thanks.  

I think I was running out of memory (i.e. bringing in too large of a recordset because of query was incorrect).

Thanks!
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question