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

openRecordset error

2
Hi,
In my VB program ,the run time error '3001' occurs when I try to execute the openRecordset statement.

Set rsCustomers = db.OpenRecordset("Customers")

Here, "db" is the connection. "Customers" is the table name. "rsCustomers" is the recordset.

The error message is like this,
"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another".

How can I correct this error?
Can anyone please help me....? I would realy appreciate any kind of help....

Thanks.
amindi.
Feb 6 '07 #1
2 3145
Tweek
17
Hi amindi,

What version of VB are you using? VB6.0, VB.NET, Access (VBA)?

being a new guy myself anything i say will probably be wrong :P

try doing a search on this site for "open database vb dao" and "open database vb ado" for some exaples of how to open a database.

this is how i've been opening mine (using ADO method)...

Expand|Select|Wrap|Line Numbers
  1. Dim cnn As ADODB.Connection
  2. Dim rs As New ADODB.Recordset
  3.  
  4. Set cnn = CurrentProject.Connection
  5.  
  6. rs.Open "SELECT * FROM Customers", cnn, adOpenKeyset, adLockOptimistic
  7.  
"Set cnn = CurrentProject.Connection" only works from within Access, otherwise you have to do some thing like...

Expand|Select|Wrap|Line Numbers
  1. oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  2.            "Data Source=c:\somepath\myDb.mdb;" 
  3.  
to open a connection


Not a perfect anwser i know but it'll give ya something to think about til someone who knows what they're talking about can help ya :)

tell us how ya go


Tweek
Feb 7 '07 #2
Esmael
58
Hi... Pls check also your reference... because base from your code... you must be using DAO connection...

Reference DAO 3.51/3.6
Sample Declaration of DAO:
Dim db As DAO.Database
Dim rsRecordset As DAO.Recordset


If you still dont get my idea... feel free to asked me more...


Esmael
Feb 8 '07 #3

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

Similar topics

5
by: Philippa | last post by:
I'm trying to access data in vba using the openrecordset command. The data in on a SQL Server 2000 database, and I have linked tables to that data. the Table I'm trying to access is one of these...
8
by: Russell Potter | last post by:
I'm trying to create a recordset using "currentDB.OpenRecordSet", using a query as the "source" string (the only parameter: so all the others are set to their defaults which, I believe, means...
2
by: MLH | last post by:
I copied the following code right out of MS Access 2.0 HELP under Index Property Setting example... Sub Button0_Click () Dim MyDB As Database, MyTable As Recordset Set MyDB =...
4
by: google | last post by:
I am trying to implement form that allows a user to update data in multiple records in a table based on criteria they enter in the form. Because I want to allow some user interaction on a record...
0
by: mo. | last post by:
I need some help in accessing Jet database using DAO. I have just started to learn c# and am trying to rewrite a program I have in vb.net to c#. In VB.Net I can do this: Dim ws As...
5
by: Sunnyrain | last post by:
I am developing a program in Access 2000. I couldn't make OpenRecordset method work right. It's working when I opened a simple SQL query below in OpenRecordset. ..... Dim dbs As Database, rst...
10
by: MLH | last post by:
Gentlemen: I am having one heck of a time taking a DAO walk through the records in an SQL dynaset. I'm trying to walk a set of records returned by a UNION query. I'm attempting to filter the...
22
by: MLH | last post by:
100 Dim db As Database, rst As Recordset 120 Set db = CurrentDb 140 PString = "SELECT qryBatchList.ReadyFor906, qryBatchList.BatchID FROM qryBatchList WHERE...
7
by: mirandacascade | last post by:
The questions are toward the bottom of this post. Situation is this: 1) Access 97 2) Multi-user appplication 3) SQL Server 2000 4) Sporadically (i.e. less than 1% of the time) encounter the...
0
by: rguidry | last post by:
Hello All, I am currently using a dao connection string for an upsized Access App with a SQL Server backend. I get the following error when trying to use the dbOpenTable type. Run-time error...
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: 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: 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
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,...
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
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
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...
0
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...

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.