Results 1 to 9 of 9

Thread: Client Side Data Collector to Server Side Database

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    5

    Client Side Data Collector to Server Side Database

    I currently have a html web page containing both visual basic and java script sections. As a result, it loads on the client side. The client answers a series of questions. Once the client has provided the information requested, he/she clicks on a "Submit" button. I want that button to transfer the answers provided on the client side to a sql database operating on the server side. I currently have a visual basic script that creates an insert string for the sql database on the client side when the "Submit" button is clicked. How do I get this insert string from the client side to operate on the server side to update the sql database? Can I pass the insert string to a php script that connects to and opens the sql database so that the insert string can be used to insert the desired data? If yes, wouldn't this require calling a php function from within a visual basic script operating on the client side and passing the insert string to the php function operating on the server side?

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Client Side Data Collector to Server Side Database

    How do I get this insert string from the client side to operate on the server side to update the sql database?
    You don't... or rather you shouldn't. Your form should be set with an Action of "Post" (form actions have two options: Get - which passes everything trhough the querystring/url - if you look at the address above right now, you'll see the post id of 756527, plus the text of the title... that's a get... The other option is a Post... where everything is sent back to the server through session/cookies/what ever it is) you should then have a PHP page on the recieving end that then know what to do with the data and it's the THAT code that should be inserting the data into the database... you shouldn't be doing it from the client.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    5

    Re: Client Side Data Collector to Server Side Database

    Thank you for your speedy response, tg, but the information I am collecting is not being gathered using a form. I've used javascript to create a series of 20 to 30 tabbed pages with yes/no checkboxes and some buttons which appear under a header containing 6 fields of text data. This could not be done on your typical form. Therefore, there is no "Post" or "Get" action to initiate. I understand that security is important but I still need to find a way to get the answers provided by my users on the client-side into the database which exists on the server-side. Does this suggest any other answers?

  4. #4
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: Client Side Data Collector to Server Side Database

    What is your submit button sat on? I would have expected that, at least, to be a form. Set that form's action to post. Your javascript pages can add all teh information required to the session object ready to be submitted from the main form.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    5

    Re: Client Side Data Collector to Server Side Database

    Scratch what I said earlier. I've been working on this tool for a number of months and got confused with the nearly 30,000 lines of code I've written. It is a complex form but a form nonetheless. My submit button is intended to do two things. The first is to verify the data to be input. It checks to see if all of the fields have been filled in and that the email address provided generally fits the format of an email address. If something is missed or appears to be incorrect, the user is prompted to verify the information before it is submitted. This is all done on the client-side. Only after the the data is verified and the client consciously decides to submit it is the data actually submitted to the server side database. This is why I have not used the "Post" and "Get" options previously suggested.

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Client Side Data Collector to Server Side Database

    I'm still confused why it's a problem... in the onClick event of the button, you can do your data validation... then once it's done, use the form.post method (from JS) to post the form to an address...

    I've done it before (don't have a copy of the code handy, or I'd post it) but this https://www.google.com/search?q=post...rom+javascript should help...


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Client Side Data Collector to Server Side Database

    This seems like the perfect time to use Ajax to post the data and get a response. Is that outside the realm of what you can do?

    I'm also curious about something. How do you have VISUAL BASIC code in a web page?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Client Side Data Collector to Server Side Database

    I'm also curious about something. How do you have VISUAL BASIC code in a web page?
    It only works in IE, flaky at best, and it's done the same way javascript is - with a script tag, but it's VBScript instead of javascript.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    5

    Re: Client Side Data Collector to Server Side Database

    Thank you all for your help. I'll keep working at it.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width