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 > Pro VB Databases
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 30th, 2006, 05:01 PM
Authorized User
 
Join Date: Mar 2006
Location: Calexico, CA, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default OTHER: Pass query result to a Form

Hi, i make a code fully based on this this topic: http://p2p.wrox.com/topic.asp?TOPIC_ID=31077 It call and execute a .bat file, afther that it should run an sql query, pass the result as a variable and print it in the MsgBox myY, but it doesnt do it... what im missing?

Code:
Private Sub CmdRMSfile_Click()

Dim strCmd As String
Dim ds As Database
Dim dds As Recordset
Dim myY
Dim k As DAO.QueryDef

strCmd = """C:\xml2odbc\po.bat"""
Shell strCmd

Set ds = OpenDatabase("C:\OM-TEST\StoneEdge\SEOrdMan2002.mdb")
k = "select MAX(OrderNumber) from [Orders];"
Set dds = ds.OpenRecordset(k)
myY = dds!kk
MsgBox myY
ds.Close

End Sub
thanks in advance
Reply With Quote
  #2 (permalink)  
Old March 30th, 2006, 07:48 PM
Authorized User
 
Join Date: Mar 2006
Location: Calexico, CA, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

got it... i miss a "select MAX(OrderNumber) as [kk] from [Orders];" in the sql... query
Other question... how can I have the sql query to wait until the "Shell strCmd" is done in order to be executed...?

Reply With Quote
  #3 (permalink)  
Old April 3rd, 2006, 03:47 AM
Authorized User
 
Join Date: Mar 2006
Location: Bratislava, , Slovakia.
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
For wait until the Shell is done use API WaitForSingleObject
Peko

Reply With Quote
  #4 (permalink)  
Old April 4th, 2006, 11:14 AM
Authorized User
 
Join Date: Mar 2006
Location: Calexico, CA, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
pass the result of a query to a variable ... eusebio Pro VB Databases 6 March 30th, 2006 07:41 PM
Show result from query akibaMaila VB.NET 2002/2003 Basics 2 January 18th, 2005 12:43 PM
Unexpected result from the query tsimsha Classic ASP Databases 1 August 23rd, 2004 03:50 AM
Query Result mateenmohd SQL Server 2000 0 November 1st, 2003 03:53 AM
Archiving query result Ned SQL Server 2000 5 October 8th, 2003 03:34 PM



All times are GMT -4. The time now is 06:57 AM.


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