Connecting w/ VB6 vs Browser

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

Bob SchneiderCo-OwnerAsked:
Who is Participating?
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
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
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
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
 
Bob SchneiderCo-OwnerAuthor Commented:
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
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.

 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
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
 
Bob SchneiderCo-OwnerAuthor Commented:
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
 
Bob SchneiderCo-OwnerAuthor Commented:
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
 
Bob SchneiderCo-OwnerAuthor Commented:
Man I really appreciate the help!!
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Thank you! I am interested to know what you found.  Post back here what you ended up doing!
0
 
Bob SchneiderCo-OwnerAuthor Commented:
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
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I think this is one of those things that sounds very easy on the outside until you get into it.
0
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.