Web Design and Development Forums

[SOLVED] Database Connection Error Message

This is a discussion on "[SOLVED] Database Connection Error Message" within the ASP Forum section. This forum, and the thread "[SOLVED] Database Connection Error Message are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > ASP Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Oct 29th, 2007, 05:15   #1 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,560
Blog Entries: 2
Send a message via Yahoo to Monie
[SOLVED] Database Connection Error Message

I wanted to do an error massage in my ASP-MySQL page more similar to what I've learned in PHP.

Can this be done in ASP page? Thanks..

PHP: Select all

// 1. Create a database connection
$connection mysql_connect("localhost""root""mypassword");
if (!
$connection){
      die(
"Databse connection failed: " mysql_error()));

Attached Images
File Type: png error.png (3.7 KB, 27 views)
__________________


Last edited by Monie; Oct 29th, 2007 at 06:07.
Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Oct 29th, 2007, 15:09   #2 (permalink)
Junior Member
 
Join Date: Aug 2007
Location: Haverhill
Posts: 40
Re: Database Connection Error Message

Hi Monie,

Have you tried using something like this
HTML: Select all
<%
If Err.number <> 0 then     'if there is an error 
response.write Err.number     'write out the error number
response.write Err.source     'write out the error source
response.write Err.description     'write out the error description
End If
%> 
I'm not entirely sure it will produce the same kind of output as the php code you've posted.

Last edited by Phil; Oct 29th, 2007 at 15:13.
Phil is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Oct 30th, 2007, 01:18   #3 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,560
Blog Entries: 2
Send a message via Yahoo to Monie
Re: Database Connection Error Message

Yeah I've tried that, but I am looking for something more specific, like PHP does!
Thanks..
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 1st, 2007, 07:33   #4 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,560
Blog Entries: 2
Send a message via Yahoo to Monie
Re: Database Connection Error Message

Any one with ASP geek might help?
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 1st, 2007, 14:46   #5 (permalink)
Junior Member
 
Join Date: Oct 2007
Location: Israel
Age: 20
Posts: 31
Re: Database Connection Error Message

as phil said you can do the error object http://www.w3schools.com/ado/ado_ref_error.asp

but i think that the die statement is more like "on error resume next"
you can look for it in this ADD sample
http://www.w3schools.com/ado/ado_add.asp

you can play with them both to make your own message or a real ADO error jibrish text
Eran is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 2nd, 2007, 03:34   #6 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,560
Blog Entries: 2
Send a message via Yahoo to Monie
Re: Database Connection Error Message

Thanks Eran, really helps me with all the question in mind
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 2nd, 2007, 08:08   #7 (permalink)
Junior Member
 
Join Date: Oct 2007
Location: Israel
Age: 20
Posts: 31
Re: Database Connection Error Message

no problem :]
Eran is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Getting the &quot;Microsoft JET Database Engine error '80040e14'&quot; error. VegaLA ASP Forum 3 Jan 26th, 2008 00:12
[SOLVED] Easiest way to open database connection! Monie MSSQL & Access 4 Nov 1st, 2007 07:35
Keep getting error message Microsoft VBScript runtime error '800a01a8' cpando1974 ASP Forum 2 Aug 7th, 2007 12:00
Database connection fogofogo ASP Forum 7 Dec 5th, 2005 14:25
Database Connection Strings Smokie ASP Forum 0 Aug 7th, 2003 09:51



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 21:42.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
SEO by vBSEO 3.1.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59