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

x
?
Solved

Insert and Update Masked Edit Boxes

Posted on 1998-06-28
3
Medium Priority
?
160 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
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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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

926 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