Solved

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries email authority 6 111
VBA Challenge how to code to loop through all files in folder and revise some part of the codes 15 100
ejb entity bean example 2 57
Data Analysis 7 59
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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 …

734 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