Solved

Problem with my Query... Please help.

Posted on 2004-04-05
2
471 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
2 Comments
 
LVL 34

Accepted Solution

by:
arbert earned 500 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Help 27 45
How to search for strings inside db views 4 27
Sql server, import complete table, using vb.net 9 34
Create snapshot on MSSQL 2012 3 18
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

773 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