VB (GUI) to SQL Procedures: Interface "not" populating to latest-month (needs to be run 2nd time).

I have a problem.  I need to run an Interface that picks-up data thru to the latest month.  Currently - for whatever reason - I need to simply run it twice - for it to populate data thru to the latest-month.  The 1st time around,  it picks up to the previously run month only and stops.   Then,  once I set it to run again - like I did the 1st time around - it goes thru all the way and brings in all the data inclusive thru to the current-month at hand.

Can you guys advise on how to fix this problem?  and - what could be the cause?

The GUI uses VB which then invokes SQL Procedures that pull data from a Sybase Database.  The VB is via Visual Studio 2005.

Please assist,
Thanking you for your time & help,  sincerely, Raj.
R BAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dany BalianCTOCommented:
we need a sample of your code, to know what objects are you using...
as a first estimation, i guess it is a caching issue...
if its' a crystal report object then try setting this option immediatly after loading the report file, and before sending the parameters and viewing the report


here's a full example:
Set CReport = Crystal.OpenReport("c:\myreport.rpt")
'logon to report db
CReport.Database.Tables(1).SetLogOnInfo DBServerName, DBName, DBReportingUser, DBReportingPass
'discard cached data
'show or hide group tree on the left
CRViewer1.DisplayGroupTree = True
'Set the Parameters for the Report
CReport.ParameterFields(1).AddCurrentValue startDate
CReport.ParameterFields(2).AddCurrentValue endDate
'set the report object source to current report
CRViewer1.ReportSource = CReport
'view report

Open in new window

R BAuthor Commented:
We're not using Crystal Reports here.  It's a Visual Studio 2005 using Visual Basic GUI - that then invokes SQL Procedures.  But, I'm having a problem finding what SQL Procedures it invokes, etc.  There is no current documentation here.   Whatever I found is outdated.  I'll try to get more info....  

Any advise on how to go about finding what exactly operates behind the scenes upon the push of a button?

Thanks,  sincerely ,Raj.
Dany BalianCTOCommented:
just double click on that button, and the code behind will open..
you can paste that code here, and we'll try to assist you as much we can on resolving the problem...
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

R BAuthor Commented:
I'm afraid that double clicking is the same as single clicking on the 'Execute' Button in the GUI.  It does not open the code, but just starts the execution of the Interface....

Any other way that I could get to the code that operates behind that button?

Please advise....   Thanking you for your timely help,  sincerely, Raj.
Dany BalianCTOCommented:
are you doing this in the executable?? or you do have the code!!
cos if you don't then you wont be able to see the code... :)
R BAuthor Commented:
Hi...  I do not have the code.  I'm hitting a button that says "Execute" in the GUI.  

I went to SQL Advantage and found a huge number of Procedures - but, I cannot tell at all which ones are being used by this Execute Button........

Any ideas on how I could find out which ones this execute button triggers? - and in what order?
Would this troubleshoot what's going wrong with my Interface having to be run twice to pick-up the latest pay-period data?

Thanking you for your time & feedback...
sincerely, Raj.
Dany BalianCTOCommented:
unfortunately raj, there's no easy way to know what this button executes from the binary file... (if it can be done, then it must be done by reverse engineering)

the best way to try to figure it out is.. estimate what the button is performing and checking the names of all the procedures.. the closest name to the button's function.
ex: if it's voiding a sale, try looking for procedure names like sp_voidsaleitem or anything similar...

if besides calling the procedure, the button is executing other codes, then we can't know.. if you find the procedure, then you can debug the code, by checking the parameters that are being sent to the procedure, or even maintain the code if anything wrong...

i'm sorry but this is how things are...

R BAuthor Commented:
Thanks for the detailed response...  One last question:  If I sit next to the Sybase DBA, while I hit that Execute Button,  would she/me be able to see and monitor which procedures are running?   We have a Sybase Database.  

Before I approach our Sybase DBA with this request/scenario - I want to ask you if this is at all possible? -  to watch from the DBA's view and be able to see what is happening upon hitting that Execute Button.....

I don't want to propose this - if it's not a possible venture in technicality......  I'll really look silly asking if it is not do-able..... technically.....

Please advise......  thank you,  Raj.
Dany BalianCTOCommented:
well, you cant know the executing procedure name automatically but what you can do, is the following: you can put a debug line in all the procedures that you suspect of... and make them print a line in the msg window of sybase...

you can try something like this:
print string('procedure yourprocedurenamehere was executed using parameters ',@param1name, ',', @param2name)

click the command button, and you will see in the server window something like:

procedure voidsalesdata was executed using parameters 1,2

ofcourse you'll have to get into every stored procedure and paste that line of code at the beginning of the code execution.

hope this helps...


Dany BalianCTOCommented:
btw when u double click on any procedure in sybase...
it will open the alter statement of that procedure...




Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
R BAuthor Commented:
Thanks for the feedback.  We'll give it a try.  I truly appreciate your time & help....   sincerely, Raj.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.