Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

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.
0
R B
Asked:
R B
  • 6
  • 5
1 Solution
 
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

CReport.DiscardSavedData

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
CReport.DiscardSavedData
'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
CRViewer1.ViewReport

Open in new window

0
 
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.
0
 
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...
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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.
0
 
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... :)
0
 
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.
0
 
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...

0
 
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.
0
 
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...

cheers,

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

ALTER PROCEDURE DBA.YOURPROCEDURENAMEHERE (@DATE1 INTEGER) ....



BEGIN
//SOME CODE HERE
 END

JUST ADD THE LINE ABOVE BETWEEN THE BEGIN AND END STATEMENTS...
0
 
R BAuthor Commented:
Thanks for the feedback.  We'll give it a try.  I truly appreciate your time & help....   sincerely, Raj.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now