Solved

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

Posted on 2003-11-17
8
821 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
  • 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 250 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
This article will show, step by step, how to integrate R code into a R Sweave document
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now