Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using command line parameters 1

Status
Not open for further replies.

Kate17

Technical User
Apr 4, 2002
34
0
0
KW
Hi,

I have a program that generates a pdf file from a crystal report, among other things. This report has date parameters passed to it via text boxes on a form, which the defaults are 1st and last day of previous month.

I would like to carry out this function by passing command line parameters (we want to link it with an asp page on our web server) but I have no clue how to do this. Can anyone tell me how to go about doing this, or any good websites that will help me. I have trawled through search engines but have not found anything particularly useful.

Thanks Kate
[reading]
 
Just to add a quick note - I would like to pass the parameters through the command line like this:

vb.exe reportID startdate enddate Kate
[reading]
 
As far as including the paramters in the command line, just build up the command line as a string, just as you would type it from a command prompt.

CmdLine = "vb.exe reportID startdate enddate"
Shell (CmdLine, vbNormalFocus)

Now, look into the Command$ function - This function would be in the Startup routine of the VB program to extract the command line parameters. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Thanks for that - didn't do it quite how you said, but I did get there from your pointers. Because the command line parameters will always be the same length, I used Left$ Mid$ and Right$ to split the string up and then use them with my crystal report exporting code.

Thanks again! Kate
[reading]
 
glad to help Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top