PDA

View Full Version : Message Box After DB Insert


Thatguy2001au
12-16-2002, 06:03 AM
Hi,

I was wondering if there was a way to have the browser pop up a Message Box or Alert Box which says something like "Thankyou For Adding To Your Favourites".

The problem is, is that I have a form which submits the information to to it's self and ads the data to the database, but what i would like is, once the insert has been completed to show the user a message box or alert box saying thankyou.

Is it possible??? or can i only show an alert box when the form gets submitted or the submit button is clicked on???

Any help will be appreciated.

By the way, I was wondering if anyone would have any idea or could give me an approximate for how big u think a sql server 2000 database with about 5 tables and about 5 fields in each table be if there were about 2000 records in it???

I was just wondering if someone could give me a rough estimate in MB's. Thanks guys!

codefox
12-16-2002, 06:43 AM
After you insert the record to the database, use window.open() within a script tag block, as in,
<%
...
' record inserted
%>
<script>
window.open("test.html", "_blank");
</script>

test.html will contain the "thank you..." message.

As regards the size of the sql server database, you've mentioned 5 tables with five fields each. I guess the datatype, size of each field is also required to determine the size of the database, i'm not sure though :).

oracleguy
12-17-2002, 01:01 AM
Or you could do:


<%
Dim blnInsert

... your code ... Where you'd do blnInsert=True if it added to the dbase okay

%>

<%If blnInsert=True Then%>
<script language="javascript" type="text/javascript">
alert("Thank you... blah blah")
</script>
<%End If%>


This will display a message box as soon as the page loads after the dbase has been queried.

raf
12-17-2002, 12:04 PM
database-size:

depends on a lot of things. variabletypes, missing values, used indexes, ...

I'd say : try it out by setting one up and randomly populating it. Shouldn't take long. (Probably woun't be that mucht MB's. Personally, i'd be more concernate about the datatrafic, then about the databasesize.)

whammy
12-18-2002, 12:07 AM
Me too, at work we have SQL Server databases with several millions of records in them. I'd make sure you index the fields you're going to be querying to begin with if you think your database may grow to a large size. :D

raf
12-18-2002, 08:08 AM
one more notre for the 'newbies' (from one to another :-))

adding an index will make your database a bit bigger (if size is really your first concern, this means that your going downhill) but the querys will run a lot faster on the variables (controls) with an index.
So the real trick is off coarse to analyze whitch variables will be used (mainly) for (selection) query's, and to index those variables.

Thatguy2001au
12-20-2002, 11:58 AM
Thanks guys

I'm only new with Databases so i will need to look into indexing and see if it's the right thing for me.

And thanks also with the help on the message box.