Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DATABASE DATA TYPES

Posted on 1998-10-28
2
Medium Priority
?
134 Views
Last Modified: 2010-04-30
in vb5, using a database i created in access 97, i am having
trouble with data types when i use the refresh command.
Basically, in vb5 i've defined a integer variable (a%), assigned it a number, (a=4),
Now, i have a field in a access database with the data type 'number' containing only whole numbers
When i use, in vb5, an SQL to search the database using the variable 'a' (insted of putting a number in)
ie SELECT * FROM table WHERE field1 = '" & a & "'"
the use a refresh command, it comes up with a data type error

If i change the field data type in access to be 'text' it works but i don't want to, or if i change
the SQL to field=2 it works but whats wrong with how i want to do it.
 
0
Comment
Question by:SIMONBRATT
2 Comments
 
LVL 14

Accepted Solution

by:
waty earned 100 total points
ID: 1442044
Your query is not correct :

SELECT * FROM table WHERE field1 = " & a

The ' between the value indicates that it is for string.
0
 

Author Comment

by:SIMONBRATT
ID: 1442045
Thanks
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

916 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