Solved

DATABASE DATA TYPES

Posted on 1998-10-28
2
128 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 50 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

Industry Leaders: 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
Reading the Contents of a Directory In Access VBA 5 86
Using "ScreenUpdating" 6 83
message box in access 4 52
pop out of webbrowser1 control vba6 5 41
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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

685 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