VB -Client Server to Web server Data transfer

Posted on 2002-07-02
Last Modified: 2013-11-13
Hi all,
This is a very challenging thing i have come accross now.
I Have a Client server application in VB.This has  a form with say 10 data input fields.When i press the
"save" button the data from the form gets saved in the sql server in my local network.

Now what i want is when i press the "save" Button the data has to be saved in the database in the Web-Server(any one-IIS...) as well as on the local network.
Could anyone of you guys out there can let me knwo how i can achieve this.
thankx in advance to all,
Question by:peers
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7123998
If there is a SQL Server on a Web Server (i assume it is installed...), you simply connect to your local server and after that update to the web server using the IP Address of that server (even the name should work).

I guess that you would like to have both servers ensured to have the same update, so if 1 update fails, none of the servers should be updated.

For these situations, you either
* use distributed transactions (the client application knows of the different servers to update)
* use MTS server (1 interface for the client application, the MTS component needs to update the servers)
* use replication (client updates only 1 server, replication does the rest)

I think you might think and learn about these things before you decide which strategy to follow.


Expert Comment

ID: 7124145
There is another good,reliable and simple way of doing it.

Have an ASP page located on your web server that contains the code to insert/update the table on your remote IIS Server.

In your VB program,before inserting in the local database,run the ASP page using winsock or inet control.

On successful execution of the ASP page.. only then insert/update the contents in your local database.

Angell.. I dont think replication is a good solution especially when updating remote servers since it depends a lot on the net connectivity and is not reliable for remote updates.


Expert Comment

ID: 7124151
To add.. I have been using this technique in a cramped bandwidth environment for the last 3 years and it seems to work very well.

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.


Author Comment

ID: 7126564
KC-I guess your idea will work out in my case.
The execution of the ASP page should be hidden.i.e when the user saves he should not be knowing a ASP page is also beign submitting simultaneouly.May be that is what you try to say when asking to use socket programming.
Is it possible for you to give me a small sample code so that i could try out this concept since you have beign using this for 3 years.
thankx to all ..keep writing..

Accepted Solution

chops123 earned 200 total points
ID: 7126625

In your VB code... you could do something like this

Inet1.OpenURL ""

Do While Inet1.StillExecuting

If Inet1.ResponseCode <> 0 Then
    MsgBox Inet1.ResponseInfo
End If


Your ASP page "updateDB.asp" can contain the insert statement.



Expert Comment

ID: 7140202
Knock ! Knock ! .. u there  ??

Author Comment

ID: 7148803
hi Kc,
Sorry was not well for some.
i am trying out this code what you have given.will rite here the resullt at the earliest.Thankx a lot for everyone for the response.Keep writing guy if you get any new idea.
LVL 49

Expert Comment

ID: 7971205
Hi peers,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept chops123's comment(s) as an answer.

peers, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 8018726
per recommendation

Community Support Moderator @Experts Exchange

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

839 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