Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

"Error 3001: Arguments are of wrong type..."

Posted on 2003-11-17
8
Medium Priority
?
827 Views
Last Modified: 2008-02-01
"Error 3001: Arguments are of wrong type..." while writing to stream

My application is in VB6 and my database in Access 2000

I use the ADODC to connect to the dabase. What I want to do is a simple search in the recordset and navigate to the appropriate record if found. I use the following syntax:

  adodc1.movefirst
  adodc1.find "FOLDER=" & iFolder & " AND MAJOR=" & iMajor

where FOLDER and MAJOR are the fields i want to do the search and are both INTEGER NUMBERS. Also iFolder amd iMajor are INTEGER variables which get their values from two textboxes.

The error I get is

"Error 3001: Arguments are of wrong type..."

Te strange thing is that if I use only one of the variables the thing seems to be working fine.

Any ideas please?
 
 
0
Comment
Question by:starman75
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
8 Comments
 
LVL 7

Expert Comment

by:wsteegmans
ID: 9765871
Try this ...

Because the variables iFolder and iMajor are INTEGER variables, you must typecast them to strings (because you are concatinating a Find-String)

I should also explicit use the RecordSet property. So try this code ...

  adodc1.Recordset.Movefirst
  adodc1.Recordset.Find "FOLDER=" & CStr(iFolder) & " AND MAJOR=" & CStr(iMajor)
0
 
LVL 8

Accepted Solution

by:
SNilsson earned 1000 total points
ID: 9766170

Only a single-column name may be specified in criteria. This method does not support multi-column searches.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdamth02_6.asp
0
 
LVL 8

Expert Comment

by:SNilsson
ID: 9766305
0
 
LVL 10

Expert Comment

by:D_M_D
ID: 9766489
Try this...

adodc1.movefirst
 adodc1.find "FOLDER='" & iFolder & "' AND MAJOR='" & iMajor & "'"


--------
D_M_D
0
 
LVL 8

Expert Comment

by:SNilsson
ID: 10319745
Well I do care since I'm positive that my first answer is the correct one.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question