|
I'm using the Execute method of ADODB.Connection in VB 6 to execute an SQL delete statement. The rows from the table are deleted but I (sometimes) get a runtime error:
ADO Error #-2147352566
Description Out of present range.
Source Provider
A normal reason for this would be trying to insert a numerical value that is indeed out of range - but this is a deletion(!?). I can execute the SQL (cut and pasted from the VB) in PL/SQL Developer and get no error. It's as though the state of the connection or another component of the ADO is causing the failure . Initially thought that it was something to do with the number of strings in the SQL's IN statement (169 of them, all 9 chars matching against a VARCHAR2(9) in the table) but I have now tested up to the 1000 limit (after which I get the expected Oracle error).
I have Googled for:
ADO Error Out of present range
ADO Error -2147352566
ADO Error 0x8002000A
ADO Error 8002000A
and variations on this theme but have not found anything useful.
Have any of you guys encountered this before (where it's not for the obvious reason - out of range)? Any ideas?
|
|
|
|
|
Which database driver and connection string are you using?
|
|
|
|
|
The ODBC driver is "Oracle in Oracle9iDS"
The connection string is "Data Source=TLINK30.world;User Id=T301;Password=XXXXXX;"
The application maintains this one connection throughout. All of the other queries run fine and a similar query (differering in the contents of the IN part of the expression) runs fine. It's as though one of the terms in the IN part contains invalid characters or something but they all appear to be nine characters (and are from another query on a VARCHAR2 field in another table).
I'm going to try make a query with a 10 character string in the IN part and see if I get the same error and then try to identify which string is making it fail in the real query.
|
|
|
|
|
hi
i would like to display the last 12 record from my database,using sql statement,
i tried this code:
strSQL = "SELECT last 10 *FROM tab5"
but am having the followig error message:
The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect. can anyone tell me a solution
|
|
|
|
|
Hi Dear ,
You could use order by descending like "select top 10 from tabs5 order by desc"
Thanks And Pleasure ,
Navneet Hegde
Develop2Program & Program2Develop
|
|
|
|
|
I know you have been told this before - please don't cross post on the forums. It's bad manners.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I have a table whose data is displayed in a datagrid as follows
Emp_id Emp_name Other_data
12 aa ...
13 bb ...
14 cc ...
Is there any way that instead of writing a query for each and every record,
i can use a single query for updating all records..? (The data is updated in bulk)
The backend being used is MYSQL so using arrays in a procedure is not working.. i supose it is not supported in MySQL..
Thanks.
-- modified at 4:25 Monday 30th April, 2007
|
|
|
|
|
i want to use Distincts keyword to Extract rows in a property table, i dont want to select a certain column but all based on one Column Lis_key
select * from property where
Vuyiswa
|
|
|
|
|
SELECT DISTINCT Column1, Column2, etc FROM MyTable
|
|
|
|
|
Thanks For you reply
cant i say something like * that will slect all the table distinctively?
or i have to SELECT DISTINCT Column1, Column2, etc FROM MyTable
and write down all the columns i have in my table, in my case there are more than 15 columns
?
Vuyiswa
|
|
|
|
|
Vuyiswamb wrote: cant i say something like * that will slect all the table distinctively?
SELECT * is inefficient and the result set will change if you change your database. You are better to specify the columns that you want.
Vuyiswamb wrote: and write down all the columns i have in my table, in my case there are more than 15 columns
Just 15... Then you don't have much to do. A project I worked on a couple of years ago produced result sets with over 200 columns, all individually named.
|
|
|
|
|
Thank you Very much it Helped
Vuyiswa
|
|
|
|
|
A good opportunity to find a way of getting a list of column names for that table from the DB.
|
|
|
|
|
Hi Folks,
I am unable to locate the SqlHelper Class in the Enterprise Library Release April 2007. Can Somebody tell me where exactly I can find the source code , I actually wanted to understand the source code more in order to use it efficiently.
Thanks,
Happy Programming!
Regards,
Nikhil Pagidala
|
|
|
|
|
I've not looked at this version of the Enterprise Library, but didn't they take that out in version 2?
|
|
|
|
|
I am not sure about the Jan 2007 release coz so far I was using the June 2005 release.
Can you please let me know if you get any info.
Thank You!
Happy Programming!
Regards,
Nikhil Pagidala
|
|
|
|
|
Nikhil Pagidala wrote: Can you please let me know if you get any info.
Why don't you just read up on how the Enterprise Library now works rather than how it used to work? There should be plenty of documentation and tutorials on the Microsoft site.
|
|
|
|
|
i have a "Booking" table with 3 Column:
BookingID (numeric - primary key)
CheckInDate (datetime)
CheckOutDate (datetime)
- With input are indate and outdate, i want select out free date range in Booking table, like find free room for hotel booking
Thanks.
|
|
|
|
|
I don't see how you can do it with this, you don't have a room number in the table.
Otherwise, you need to use the date functions in SQL to find which rooms are booked on a given date, or a given range, and return the other room numbers.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Can you show me some db design and algorithm about hotel booking? i tried search a hours but...
Thanks.
|
|
|
|
|
I'm not really sure what to say. You should work through a book on database design, and think your problem through. The SQL Server help has all the info you need on how to use date functions.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
<pre><code> :-O :zzz: :-\ :(( :-O :omg: :mad::confused::~ :doh: </code>
|
|
|
|
|
Hi,
Is it possible to make a stored procedure sort columns either ascendingly or descendingly base on a parameter? If not, should we ignore taking advantage of stored procedures and build dynamic SQL commands instead? (building a dynamic sql string in our stored procedure and then calling EXEC())
We don't want to use dynamic SQL commands due to two reasons:
1- preventing SQL injection vulnerability
2- stored procedures containing dynamic SQL are compiled everytime we execute them, which I think should be avoided as far as possible
thanks for any help
|
|
|
|
|
U can use if condition to test the argument
and write 2 select commands like:
if(@order=1)
select .... order by asc
else
select .... order by desc
Do U really need this or I am wrong somewhere?
Regards,
Arun Kumar.A
|
|
|
|
|
Yes this works, the problem is that for two large blocks of select statements, I should copy the whole select block and paste it into 'else' section of if statement just because I wanna sort it descendingly, it's a little annoying, isn't it?
It would be nice if there was a way to enclose the ASC/DESC section of our sql, something like this:
select * from books order by title
if(@order=1)
asc
else
desc
|
|
|
|