Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 7th, 2004, 12:33 AM
Registered User
 
Join Date: Jun 2003
Location: , North Carolina, .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Shape My Command-Please

Here's the plan. I have 2 tables not related except for a jobid field. I set up a temp table and run a sql statment on each table to insert records into the temp table from the original tables. Works great. Then I run sql statements on the temp table to create a command. See code below. Each command in iteself runs fine, but I need to join the 2 commands together inorder to run a report. For some reason I get a syntax error when I join the commands with append the cmd and pcmd together. The only thing I am trying to accomplish is to run a report like:

id qty
2412 20
2414 30
2416 40

plid plqty
321 10
215 15
336 30




strSQL = "Select jobid,id, sum(qty) as SumOfQty from " & ausername & "report Group By jobid,id"

pstrSQL = "Select jobid, plid, sum(plqty) as plSumOfQty from " & ausername & "report Group By jobid, plid"

With cmd
.ActiveConnection = cn
.CommandType = adCmdText
.CommandText = "SHAPE {" & strSQL & "} As cmdGroup1 Compute cmdGroup1 BY 'id'"
.Execute
End With

With pcmd
.ActiveConnection = cn
.CommandType = adCmdText
.CommandText = " SHAPE {" & pstrSQL & " } As pcmdGroup2 Compute pcmdGroup2 BY 'plid'"
.Execute
End With



Closed Thread


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
writing a shape to a file ironchef Java Basics 0 November 8th, 2006 06:35 PM
ado shape syntax sunpalozzi SQL Language 0 November 2nd, 2006 04:43 PM
Delete object shape name stepdev Excel VBA 0 May 3rd, 2006 12:57 PM
Rotating shape in VBA (not center of shape) Piblon Excel VBA 3 April 13th, 2006 05:04 AM
"No Fill" for Shape Objects msvedlow Excel VBA 2 September 5th, 2003 11:40 AM



All times are GMT -4. The time now is 08:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.