Can you connect to a database with VBScript?

Results 1 to 2 of 2

Thread: Can you connect to a database with VBScript?

  1. #1
    Join Date
    Dec 1969

    Default Can you connect to a database with VBScript?

    Hi,<BR><BR> I know that this isn&#039t strictly an ASP question but I wonder if you could clear something up for me. I have written an admin site that returns some records from a database and enables <BR><BR>the user to either edit the record or delete it.<BR><BR> What I&#039m aiming for is that when the delete button for a particular record is clicked on it calls a function that firstly triggers a VB yes/no <BR><BR>box to confirm the delete function. If the yes button is clicked I want to delete that record. I do have a database connection established <BR><BR>within another include file but I don&#039t seem to be able to access this from within the function. I therefore assume that you need a <BR><BR>seperate connection - is this achieved in the same way? (I&#039m using a DSN less connection) do I have to run this function server side?<BR><BR>Any help will be greatly appreciated, cheers, Dan. <BR><BR>

  2. #2
    SPG Guest

    Default RE: Can you connect to a database with VBScript?

    Okay, here&#039s what it sounds like to me (and my old fashioned Client/Server experience)...<BR><BR> - You serve a page to your user with DB info on it and these "Delete This" buttons.<BR> - When a user clicks a "Delete This", you want to confirm that they meant to do it.<BR> - If they did mean to do it, you want to detonate the record. Otherwise, you do nothing.<BR><BR>What I would do at this point is to put an onSubmit call on the/each &#060;form&#062; (if it returns true, the form is submitted, otherwise nothing happens). This is perfectly allowed in JavaScript; I don&#039t do client side VBScript (something to do with clients not necessarily having VBScript...). For fabulous assistance with getting this sort of JavaScript, check out -- it&#039s the site I use for most of my JavaScript discovery research.<BR><BR>If the submission is then sent back to your server, you can use your existing connection to "delete from fooTable where fooColumn = fooValue" and serve refreshed data to the client.<BR><BR>Note that if you&#039re in, oh say, Taiwan and serving to, oh say, Egypt, this method would probably be very very slow. Of course at that point, any method would be pretty slow; that&#039s the way the hardware is (at this point in time).<BR><BR>Hope it helps.

Posting Permissions

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