473,804 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

3 New Member
'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.Connectio nString = "Data Source=<servern ame>;Initial Catalog=HR;Inte grated Security=True"
------------------------code------------------------------------
Dim ssql as string="select * from employee_master "

lrsTemp = New ADODB.Recordset
If lrsTemp.State = 1 Then lrsTemp.Close()
lrsTemp.Open(ss ql, consc)
------------------------code------------------------------------
i get error on the last line .....i.e.. lrsTemp.Open(ss ql, consc)
i m getting mad... plz help..
Nov 5 '08 #1
6 1620
Frinavale
9,735 Recognized Expert Moderator Expert
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
gforgourav
3 New Member
thanks for ur views ..but i hav a whole project with about 30 forms and lots of such ADODB.recordset s 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 Recognized Expert Moderator Expert
thanks for ur views ..but i hav a whole project with about 30 forms and lots of such ADODB.recordset s 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.Connectio n


I think you're using the wrong connection object.
Nov 6 '08 #4
Plater
7,872 Recognized Expert Expert
thanks for ur views ..but i hav a whole project with about 30 forms and lots of such ADODB.recordset s 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
gforgourav
3 New Member
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.Connectio n


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

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

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
4645
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 = Server.CreateObject("ADODB.Recordset") rstime.Open "SELECT * FROM TimestarResorts where resortname='" & request.querystring("resortname") & "' and roomsize='" & request.querystring("roomsize") & "'", dsn, 1, 3
7
50955
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 wrote an INSERT statement that works fine however today I decided that as part of the application upgrade it should be return the record ID so I wrote the following which I admit is a little messy at places but it works. However when I added all...
15
7221
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 15 line 15 is the recordset open line. Can someone please help
1
2948
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) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /gwisnewcon/test/successconfirmation_ori.asp, line 41
6
2144
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 "string" in google comp.lang.c archives.Hope this helps.Hope I am not bothering any one. am I? =================================Start=========================== subject: Return to Start of Line? Question: I'd like printf, the next printf, to return...
17
2655
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 Info=False;Initial Catalog=MediaDB;Data Source=MEDIAMACHINE\SQLEXPRESS" Connection.Open sConnString Dim Recordset Set Recordset=Server.CreateObject("ADODB.Recordset")
12
12402
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 are of the wrong type, are out of acceptable range, or are in conflict with one another. " but if I've put amount manually and save the record then record has been successfully saved. For selection of Book Type and Publication I've used Combo...
7
2538
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. Has anyone encountered this scenario? Is this a bug? I am using VB.Net 2005. Is there any way to get out of this jam? Currently my app will only release its hold on the mdb after the app closes. I do not understand. Please help as I am on a...
0
9716
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...
1
10361
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
9179
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7644
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
6874
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();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4316
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
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3006
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.