Solved

Insert and Update Masked Edit Boxes

Posted on 1998-06-28
3
158 Views
Last Modified: 2010-05-03
Using VB 5.0, I am having trouble with the Insert Into and Update statements when saving to the
database.  I am using the following syntax ...  INSERT INTO (field1, field2,...) VALUES ('" & textbox & "','" & mskedbox1 & "'...) and I get the error :  "Syntax error in insert into statement".  The same happens with update.  I've narrowed  the problem down to the maskedit boxes (the textboxes work fine alone).  Suggestions?
0
Comment
Question by:porter062898
[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 Comments
 
LVL 2

Expert Comment

by:richtsteig
ID: 1464462
Have you checked the resulting string in both cases?

I use to include something like

#if sqltrace
clipboard.settext sqlstatement
if msgbox("continue?",vbyesno) = vbno then exit sub
#end if

when I am in an early state of developing.

This allows me to verify the SQL-statements in the
Access environment.
0
 

Author Comment

by:porter062898
ID: 1464463
When I debug, I find that the correct string is returned, but the error still occurs.  
0
 
LVL 3

Accepted Solution

by:
AndreasSchindler earned 100 total points
ID: 1464464
Try a Textbox instead of the maskes Edit. If you get an error you have a Problem according the database field and not the MaskedEditControl.
Is the MAskesEditField as String or a Number ?
Try " instead of ' ( & """,""" & ...)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month8 days, 14 hours left to enroll

617 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