473,383 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

conn.execute(sql) when failed

1
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 3344
jhardman
3,406 Expert 2GB
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
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...
3
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...
7
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,...
0
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...
4
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...
1
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...
2
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...
0
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.