473,396 Members | 1,929 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,396 software developers and data experts.

Bug in Vb.net 2005 'Arguments are of wrong type, are out of acceptable range, or are

'Arguments are of wrong type, are out of acceptable range, or are in conflict with one another'
this error occurs ...
i m using vb.net 2005 with sql server 2000 backend
i had a project in vb 6.0 with MS access
i hav converted it to vb.net 2005 and hav made all necessary changes in code
now as the project was in vb 6.0 it has adodb recordset for fetching data from table
now whn i m using sql server connection string i get this error..
my code is as below,...
.------------------------------------------------------------
Public consc As SqlConnection
.------------------------conection string--------------------------
consc.ConnectionString = "Data Source=<servername>;Initial Catalog=HR;Integrated Security=True"
------------------------code------------------------------------
Dim ssql as string="select * from employee_master"

lrsTemp = New ADODB.Recordset
If lrsTemp.State = 1 Then lrsTemp.Close()
lrsTemp.Open(ssql, consc)
------------------------code------------------------------------
i get error on the last line .....i.e.. lrsTemp.Open(ssql, consc)
i m getting mad... plz help..
Nov 5 '08 #1
6 1591
Frinavale
9,735 Expert Mod 8TB
Instead of using a ADODB.Recordset (which is quite out dated) consider updating your code to use the tools that .NET provides you with to connect to the database and fetch the information.

Check out this quick reference on how to use a database in your program.

-Frinny
Nov 5 '08 #2
thanks for ur views ..but i hav a whole project with about 30 forms and lots of such ADODB.recordsets used .. and its not feasible to change the code on all locations..
so plz if possible suggest any other solution
Nov 6 '08 #3
Frinavale
9,735 Expert Mod 8TB
thanks for ur views ..but i hav a whole project with about 30 forms and lots of such ADODB.recordsets used .. and its not feasible to change the code on all locations..
so plz if possible suggest any other solution
I've only briefly worked with ADODB record sets in .NET....
But try changing your:
Public consc As SqlConnection

To be:
Public consc As ADODB.Connection


I think you're using the wrong connection object.
Nov 6 '08 #4
Plater
7,872 Expert 4TB
thanks for ur views ..but i hav a whole project with about 30 forms and lots of such ADODB.recordsets used .. and its not feasible to change the code on all locations..
so plz if possible suggest any other solution
Is it not the point of upgrading, to DO just that, UPGRADE?
Nov 6 '08 #5
I've only briefly worked with ADODB record sets in .NET....
But try changing your:
Public consc As SqlConnection

To be:
Public consc As ADODB.Connection


I think you're using the wrong connection object.
....
it was this previously..
Public consc As ADODB.Connection

i want sql connection so i did change it to this..
Public consc As SqlConnection
Nov 10 '08 #6
Plater
7,872 Expert 4TB
....
it was this previously..
Public consc As ADODB.Connection

i want sql connection so i did change it to this..
Public consc As SqlConnection
Right, but you want to use ADO recordsets instead of regular .NET objects.
I think you need to use "like with like", if you want ado recordsets you need to use the ado connection object, if you want to use the SqlConnection object, you'll need to use the SqlCommand, SqlDataAdapter, etc objects.

Upgrading is never an easy process
Nov 10 '08 #7

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

Similar topics

1
by: J. Muenchbourg | last post by:
I'm getting an "Arguments are of the wrong type, out of acceptable range, in conflicts with each other " error , pointing to the sql statement in this block: Dim rstime Set rstime =...
7
by: Tim Gaunt | last post by:
Hi, I'm hoping that someone will be able to help me with this one, I'm developing an application which basically inserts a load of data into the database ready for validation at a later date, I...
15
by: Erica | last post by:
I'm getting the following error: ADODB.Recordset error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /shop/results.asp, line...
1
by: Jack | last post by:
Hi, I am trying to add a new record to a main page. This page is the processing page to a form. However, I am getting the following error message: Error Type: ADODB.Recordset (0x800A0BB9)...
6
by: sathyashrayan | last post by:
Following are the selected thread from the date:30-jan-2005 to 31-jan-2005. I did not use any name because of the subject is important. You can get the original thread by typing the subject...
17
by: Anil Gupte | last post by:
I am using the following to try to connect to the database, but it does not seem to be working. Dim sConnString sConnString = "Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security...
12
by: anantraoneel | last post by:
Hi Friend My project is a Library System. In Project is Book Master form. If I've select Book Type from Type Master and Publication from Publication Master then this error has come: "Arguments...
7
by: The Mad Ape | last post by:
When I use the code below to create an mdb (access database) I am unable to release it and the locking file remains persistent. For my app this is bad if the user tries to delete the mdb later on....
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.