Solved

Insert and Update Masked Edit Boxes

Posted on 1998-06-28
3
153 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 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now