#1 (permalink)  
Old 04-03-2007, 10:41 AM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,438
ASP/Access Question

I am working with ASP VB and Access for the first time, and I have a question about functionality.

Is there any way with ASP VB to check to make sure my query was performed successfully?

In PHP/MySQL, the statement I'm looking for would look something like:
PHP Code:
if(!mysql_query($sql$link)) {
die(
"There was an error".mysql_error());
}
else {
echo 
"Everything went swimmingly";

However, I'm not sure if that is even possible in ASP VB/Access, and if it is, I really don't have the first clue how I would write it. The code I'm currently using is:
Code:
	set rsImpact = adoCon.Execute(strSQL)
I just don't see how I would be able to put that into an "if...else" statement. Any help would be appreciated.
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote

  #2 (permalink)  
Old 04-03-2007, 12:47 PM
Deadeye's Avatar
Moderator
 
Join Date: Aug 2005
Location: San Diego, CA
Posts: 274
Send a message via MSN to Deadeye
I've never written VB but inside C# there is a try catch (optional finally) method that will check for any exceptions. I'd look up this or its equivalent for VB.

Sorry I'm not a huge help here, but this is the best i can do.

The try catch method looks like
Code:
try
{
   code;
}
catch (Exception e)
{
   MessageBox.Show("There was an error\m" + e.toString());
}
finally
{
   connection.Close();
}
Wesley
Reply With Quote
Reply


Thread Tools
Display Modes 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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript Code Question O~Snapple Programming and Scripting 1 02-16-2007 02:36 PM
Another newbie question ehbowen Programming and Scripting 2 10-19-2006 01:36 PM
Newbie simple question abia Programming and Scripting 2 08-06-2006 01:09 PM
general iframes question ice77ice Programming and Scripting 3 04-05-2006 07:00 PM
Another Image Rollover Question skinner69 Programming and Scripting 1 02-26-2006 10:58 PM


All times are GMT -5. The time now is 01:11 AM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter