|
 |
asp_databases thread: Message Box
Message #1 by "Noumaan Abubakar" <noumaan_abubakar@m...> on Wed, 30 May 2001 13:16:48
|
|
Can anyone help please...
I have created an asp page that allows users to add data to a database.
Before I add the record to the database I check to see that no duplicate
records already exist, if there are I want to prompt the user that the
record already exists.
The problem that I am facing is that, the MsgBox function that I am using
does not work. The error message that I get is shown below.
Permission denied: 'MsgBox'
Does anyone know why I get this message?? and how I can overcome the
problem??
Thankyou in advance
Noumaan
Message #2 by "Daniel Walker" <danielw@w...> on Wed, 30 May 2001 13:25:53
|
|
Woa, there, fella! :)
This is ASP, remember, and so there are two computers involved: the server
and the client. The message box you're trying to open is a messagebox on
the _server's_ desktop - you're not allowed access to the server's
desktop.... for obvious reasons, if you think about it - after all, who's
going to press the "OK" button, for a start?
What you need is the Javascript alert, which will open client-side, in the
client's browser. This emans you'll have to start doing some client-side
scripting in Javascript.
Daniel Walker
Wrox Press
> Can anyone help please...
>
> I have created an asp page that allows users to add data to a database.
> Before I add the record to the database I check to see that no duplicate
> records already exist, if there are I want to prompt the user that the
> record already exists.
>
> The problem that I am facing is that, the MsgBox function that I am using
> does not work. The error message that I get is shown below.
>
> Permission denied: 'MsgBox'
>
> Does anyone know why I get this message?? and how I can overcome the
> problem??
>
> Thankyou in advance
>
Message #3 by "vishal mishra" <vismis@r...> on Wed, 30 May 2001 13:36:02
|
|
Hello Nouman,
Your Problem is that May be you are writing the code of
vbscript(msgbox function)in the action file i.e., in the action
file.vbscript is an client side Programming. so if you want the user to
restrict the user to not to enter any data by comparing it with the
database, then do one thing store the value of the existing database into
the front-end file in the text boxes and then compare the values of the
text box with the text box having values of the database.
If you find any other solution then do let me know since i
was also facing the same problem amd have done research for about a month.
if you want the source code of the above mentioned solution then let me
know i will let you know.
Regards,
vishal.
> Can anyone help please...
>
> I have created an asp page that allows users to add data to a database.
> Before I add the record to the database I check to see that no duplicate
> records already exist, if there are I want to prompt the user that the
> record already exists.
>
> The problem that I am facing is that, the MsgBox function that I am
using
> does not work. The error message that I get is shown below.
>
> Permission denied: 'MsgBox'
>
> Does anyone know why I get this message?? and how I can overcome the
> problem??
>
> Thankyou in advance
>
Message #4 by "Noumaan Abubakar" <noumaan_abubakar@m...> on Wed, 30 May 2001 15:21:16
|
|
Vishal,
I haven't got any problem with checking values before putting them into
the database, to ensure there are no duplicate values. Anyway I've
included some code that should provide you with the answer or atleast help
you out.
sqlstr = "SELECT * FROM summary"
'open the RS4 recordset object
RS4.Open sqlstr4, Conn, 3, 3
flag = false
'step through the summary table
While Not RS4.EOF
if RS4("week_commence") = LDate Then
'flag is set to true if the value is in database
flag = true
End if
RS4.MoveNext
Wend
'add new record
if flag = false then
RS4.AddNew
RS4("week_commence") = LDate
RS4("received") = RecCount2
RS4("outstanding") = RecCount3
RS4("closed") = RecCount
RS4("average") = averg
RS4.Update
End if
hope this helps you out Vishal,
Noumaan
|
|
 |