Re: Newbie question on INSERT command



On Nov 27, 9:56 pm, "Jerry West" <j...@xxxxxxxxxxx> wrote:
I'm using VB6 to create a new record in a Access db. I'm doing so like this:

INSERT INTO Customers (Name Prefix, First Name, Last Name, Name Suffix,
Company, Phone, Email, Address1, Addres2, City, State, Zip, Country) VALUES
('', 'Din W.', 'Cambell', '', '', '1 8055553128', notr...@xxxxxxxxx', '12345
Molkai Drive', '', 'Nowhere', 'SC', '19708', 'USA')

The error I get back indicates a syntax error. I've looked around at some
examples but I don't see where I'm going wrong. Could it be the empty
values?

Any insight much appreciated!

JW

How about Addres2. Did you really spell Address1 and Addres2 so
differently?
How about , notr...@xxxxxxxxx'; clearly we have a single-quote
missing.

But really, it's a stretch for you to ask us to correct your syntax
when you post an example. How can we know if the errors we see are in
the example only, or in the actual code fragment?
The zero length strings may or may not be a problem, depending upon
how your fields are defined. In general, zero length strings can cause
high blood pressure, sweating, and inappropriate muttering I never
allow them.
.



Relevant Pages

  • Re: kid wants to know more about color on the screen
    ... He and I have no programming ... > does a run script there will be a syntax error as Python wont recognize this ... it is possible to print colored text in Python. ... These are strings starting with the control ...
    (comp.lang.python)
  • SNMP community string starting w/special a prob on Sol 8?
    ... Our standard community strings start with a special character. ... syntax error in at line 20: the token < is not valid ... Trying to 'quote' or "quote" the strings yielded: ...
    (SunManagers)
  • Re: please help
    ... What sort of syntax error? ... size, etc., line breaks will be introduced in the copy-paste step that ... manipulate internet-downloaded data where the split of strings into ... Break the string and put each of them in separate cells (e.g. ...
    (microsoft.public.excel.programming)
  • Re: calculating Subtotals in Access Reports but under certain criteria.
    ... || donot know why this is not working- is showing syntax error. ... It appears you want the first character so change it to: ... For Sumyou can use zero. ... But if you use other functions only nulls can give ...
    (microsoft.public.access.queries)
  • Re: Compile error about MACRO
    ... In the MERGE macro, a is replaced by the string "hello", not the token ... You only use quotes in macro arguments when you want strings. ... which is definately a syntax error. ... operator works on tokens not on strings. ...
    (microsoft.public.vc.language)