[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Data Type of Character in FoxPro and VB datatype

Posted on 2000-04-13
4
Medium Priority
?
232 Views
Last Modified: 2013-12-03
My program code,

objCms.Find "code = " & strCode

objcms is recordset reading from FoxPro dbf file. "code" field in dbf table is characters(6) datatype. And strCode in VB is string datatype. The system gives an error message saying "Type mismatch..". How can I solve this type mismatch problem?
0
Comment
Question by:kennethan
[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
  • 2
4 Comments
 
LVL 10

Expert Comment

by:Dxpert
ID: 2714410
Are you sure that the Data Type for the field "CODE" is "Character", it seems to me that it is a "Numeric" field.
0
 
LVL 10

Expert Comment

by:Dxpert
ID: 2714419
..also, just make sure that strCode is a character string.
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 80 total points
ID: 2715173
dxpert, you are on the right lines but I don't think you made yourself clear;

objCms.Find "code = " & strCode

will fail when searching a character field.

objCms.Find "code = '" & strCode & "'"

will succeed.

The problem being that unless you surround the string to be matched in quotes, it is interpreted as a non-character value this is what gives rise to the error.
0
 

Author Comment

by:kennethan
ID: 2716563
Adjusted points from 15 to 20
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

656 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