Solved

Connecting w/ VB6 vs Browser

Posted on 2013-01-09
10
316 Views
Last Modified: 2013-01-22
I have a timing service that uses a vb6 application to time races on site.  I can run it off the the db on the local machine (in the event that I do not have any connectivity at the race) or off of the db on the server.  My question is that, even when I have connectivity, the vb app runs very slowly in comparison.  Probably too slowly to ever use as a reasonable option.  Here is my connection string:

 
    Set m_oConn = New ADODB.Connection
    
    If sWhichSrvr = "Remote" Then
        m_oConn.Open "Provider=SQLNCLI10;Server=216.185.199.1,1433\SQLExpress;Database=CCMeet;Uid=uid;Pwd=pwd;"
    Else
        m_oConn.Open "Provider=SQLNCLI10;Server=VIRA-5\SQLExpress;Database=CCMeet;Trusted_Connection=yes;"
    End If

Open in new window

0
Comment
Question by:Bob Schneider
  • 5
  • 5
10 Comments
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 500 total points
ID: 38758617
Why do you think it is the connection string?   I think your going to see some lag time online and depending on how your app works, it may just run slow on the web server.

I have never worked on a timing app before but I would think for something like a race you need the actual accurat start and stop and that should be recorded locally.  Now if you are using a web app to display the time, I would first save the start time to local using a stored procedure to capture the time recorded from the db.  Then push that time out to the web server.  Then simply use javascript timer to show the time time based on the recorded time.  This does mean there will be a slight delay in showing the the time online but it will be accurate.  Then when it is time to stop, run a local stored procedure to record the time ended and then throw that up on online.  Again you will see a slight delay in the actual finish time online.  But you could have it read "00:00:00.000 Official"

By recording the actual time local, you will have accuracy.  I wouldn't trust online timing because of lags.   If you do trust it, do the same just use a stored procedure to capture the time online.  But use javascript to display the time from the recorded time as it runs faster for this kind of thing.
0
 

Author Comment

by:Bob Schneider
ID: 38759862
Thank you.  The timing is all done locally but it ultimately goes on the web server for access to the online results by the world at large.  I can work offline and then upload the results when all is complete and I am back to "the office" or I can work directly off of the server db.  My question was that the local software lags dramatically if it is accessing the data via the server as compared to accessing the data on the local machine.  Just wondering if this is an inherent issue with a vb6 app/connection and if there is a better (quicker way) to connect my vb6 software to the data on the server.

My web interface (using basically vbscript) retrieves, processes and submits data much more quickly than my vb6 app does.
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 500 total points
ID: 38759964
Maybe have this question posted in SQL Databases and servers.  I t does make sense thought what you are saying.  But the issues could could be the obvious fact it is on the web.  But it could have to do with the database too.  For instance, I have duplicate sql databases with virtually the same data and one runs faster and it is because of the the index's I have on one and not the other.

Is it possible your online database has more data?  less resources? memory?  I have databases both on shared services and dedicated box's and the shared sql databases are very slow for anything more then simple queries or smaller amounts of data.

What about posting your needed query via ajax/xmlhttp online as jsonp and retrieving what you need that way.  

If you are confident your database is in order,  I would say post this to the server/sql area  or hopefully somebody else with different experience can chime in.
0
 

Author Comment

by:Bob Schneider
ID: 38761473
I will do that but, again, the data is the same...it is just being accessed by two different means: the web via a browser and web site, and via a software app written in vb6.
0
 

Author Comment

by:Bob Schneider
ID: 38808121
It is just sooooo sloooowwww when using vb6 as opposed to asp/web browser.  The queries are the exact same and the databases are "identical" in the sense that I copy the one on the server to my local machine.  Then I can run my vb6 software or the web app, but the web app is only capable of a fraction of the tasks.  I am trying to avoid re-writing everything to the asp site.  From a data standpoint, the connection strings are also very similar.  It actually connects pretty well but when it comes time to actually process the data, the vb6 app takes three or four times as long (or more).  It makes it so I can't run the app off of the server which sucks because then I can't provide real-time results for participants.

Any final thoughts would be much appreciated.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 38808179
I thought I saw an answer for you in another question.  

I wonder if part of the answer is the web app is on a web server optimized for this.  There was a question like this here on EE when http://www.experts-exchange.com/Software/Server_Software/Content_Management/WebBased_CMS/Joomla/Q_27808961.html

I am starting to not use traditional asp pages where the page is doing everything from accessing data with to making the page pretty.  Instead, I am treating everything as a web service.   And this helps as I prepare to work more on mobile.

What if your online asp page to add/view/edit was simply just that and t hen have it return a response of either "updated" or "error"
<%
key=request.form("key") ' md5 or sha1 hash of a password, date and other data to prove it is you making the request
action=request.form("action")
param1=request.form("param1")
':
param5=request.form("param5")

'--- add a runner ----
if action="add" and key=md5(salt1&salt2&salt3...salt5) then
   ' run your insert code
    response.write "added "&now
end if

'--- edit a runner ----
if action="edit" and key=md5(salt1&salt2&salt3...salt5) then
   ' run your edit code
    response.write "updated "&now
end if

'--- set a time for  a runner ----
if action="settime" and key=md5(salt1&salt2&salt3...salt5) then
   ' run your update code
    response.write "updated "&now
end if

%>

Open in new window

Now, it does not matter if you are using your online web pages or your desktop vb.net or a native mobile app,  you simply run an xmlhttppost to this page.  No need to have any log in info on this page, Just a good "key".

If you need to get a response back of data, you can either format the response as tables and divs (might take longer) or as xml or json.  I like  using http://code.google.com/p/aspjson to create a json response.  Then use javascript/jquery to parse it.

This could speed things up.  Otherwise, somebody more versed in networking may have a better answer.
0
 

Author Closing Comment

by:Bob Schneider
ID: 38808194
Man I really appreciate the help!!
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38808204
Thank you! I am interested to know what you found.  Post back here what you ended up doing!
0
 

Author Comment

by:Bob Schneider
ID: 38808212
Will do...it is time for me to branch out a little in terms of my scope of capability.  This will be a good chance to do that.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38808218
I think this is one of those things that sounds very easy on the outside until you get into it.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now