473,799 Members | 2,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

conn.execute(sq l) when failed

1 New Member
Hi,
I was wondering about this statement

Rs=conn.execute ("Select * from table where id=232")

what is the result of Rs if id 232 is not found?
And how do I catch this exception like :
If not Rs then...?

thanks
May 31 '07 #1
1 3388
jhardman
3,406 Recognized Expert Specialist
Hi,
I was wondering about this statement

Rs=conn.execute ("Select * from table where id=232")

what is the result of Rs if id 232 is not found?
And how do I catch this exception like :
If not Rs then...?

thanks
The recordset will show EOF (end of file) as if you were looping thru the recordset and got to the end. To handle, you can say:
Expand|Select|Wrap|Line Numbers
  1. if rs.eof then
  2. ...
  3. end if
or like this...
Expand|Select|Wrap|Line Numbers
  1. if NOT rs.eof then
  2.    'perform all the code you want
  3. else
  4.    response.write "Sorry, no records were found"
  5. end if
Let me nkow if this helps.

Jared
May 31 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1977
by: mike | last post by:
Am I correct in assuming that when the starting value of a select list is re-selected, the onChange command does not execute? I need to have it execute when the original value is selected if possible. -- Mike
3
9805
by: Lyle Fairfield | last post by:
MS-SQL Server utilities Enterprise Manager and Query Analyzer will model almost any MS-SQL object as a simple script file with a default ".sql" extension. But how to "run these files? They are in a slightly modifies character set and contain commands only usable by the Server's SQL utilities. If one tries to use them on a machine which does not have the SQL utilities installed, one seems to have a laborious cut-and-paste task. (Of...
7
3220
by: JIM.H. | last post by:
Hello, Is there any difference to between SLQ string in the code and call execute query and call a stored procedure and execute the query that way concerning speed, effectiveness, reliability, …? Thanks, Jim.
0
1319
by: satish | last post by:
hi, i have a problem while connecting the Folder in executing sql task in execute sql statements in loop example in Intergration Services --2005 the actual problem -- i have given the sql source as file connection path ie.., existing folder ... and also mentioned in the Enumerated configuration in For Each loop Editor and mentioned *.sql at the Files section -- so the create tables have to be run inside the for loop editor it is not...
4
19694
by: jram01 | last post by:
Hi Folks, I am facing problem to to execute .sql command in sql prompt using perl script. I am able to connect sql promt using " my $odbcinput = "odbcinput.txt"; my $odbcoutput = "odbcoutput.txt"; open (ODBCSQLFH, ">$odbcinput") || die "Unable to create input file ($odbcinput) for odbcsql\n";
1
4380
by: leofdz | last post by:
I tried calling an AS400 stored procedure in SSIS using an execute sql task. The task started executing but never completes and I am not getting any error messsage. There is no problem with AS400 stored proc. I used ADO.Net - ODBC connectivity to connect to AS400 server using IBM client access driver. Please let me know if there is any way to call an AS400 stored proc.
2
37648
by: raghutumma | last post by:
Hi, How can we execute SQL Scripts using Batch file??? i think Batch file should contain Username,Password,Database and Scripts... Using that file scripts should run... How can i give UserName,Password,Database and all those things?
0
1076
by: amitp | last post by:
Hello, I've a DTS Package in which i'm using Execute SQL Task. It's having a connection CON1. I've a function which is defined at DataBase level CON2. The query in the Execute SQL Task is an Update Query. It takes data from CON2 and updates in CON1. SO how can i call the function which is defined at database level into my Execute SQL Task update query. I don't know the syntax. Also that function taking 3 input parameters which i'm...
1
5398
by: theschaef | last post by:
Hi there. I am using perl to connect to a database and then pull the rows off of the table one by one to manipulate the data. If I use a smaller table (~8 MB), I wait for around 20 seconds but then the table values are read just fine. However if I use a larger table (~30 MB), I wait for a while and then I get the message: DBD::mysql::st execute failed: Lost connection to MySQL server during query I have tried searching for the...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10488
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10237
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10029
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7567
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6808
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4144
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.