Solved

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

Posted on 2003-11-17
8
822 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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.
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

895 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

13 Experts available now in Live!

Get 1:1 Help Now