473,509 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

insert into sql statement not working why?

14 New Member
here is my code - whats wrong?

Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False
  2.  
  3. sSQL = "INSERT INTO tbl_temp " & _
  4. " ([WhoFrom]) VALUES ('" & x & "');"
  5.  
  6. DoCmd.RunSQL (sSQL)
  7. DoCmd.SetWarnings True
error i get is #3075 - "syntax error - missing operator in query expression"

i have

Expand|Select|Wrap|Line Numbers
  1. DIM sSQL as String
  2. DIM x as String
in tbl_temp field WhoFrom is text
Dec 10 '10 #1
1 3648
gershwyn
122 New Member
I see nothing wrong with your SQL as is.

Are you getting that error on the DoCmd.RunSQL line, or might it be elsewhere in your code?

It might also be a good idea to add
Expand|Select|Wrap|Line Numbers
  1. Debug.Print sSQL
before you execute it, to be absolutely sure what the program is seeing is what you expect it to be seeing.

Edit: What value are you using for X? There wouldn't happen to be an apostrophe or something similar, would there?
Dec 10 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
3375
by: Mike | last post by:
I know this sounds strange but I am at a loss. I am calling a simple funtion that opens a connection to a SQL Server 2000 database and executes an Insert Statement. private void...
2
1585
by: eric dugal | last post by:
Hi all!! I need your help.... i'm working since 2 hours on a simple insert statement, but couldn't handle it. Here is my code : public int ExecQuery(string SqlString) {
2
1666
by: Paul Mason | last post by:
Hi folks, The ado.net stream appears to be not working so I'm here. The following function generates the error "Operation must use an updateable query". There is no identifiable or meaningful...
2
3169
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
1
3070
by: glenn | last post by:
Hi folks, I am using an Access database, VB.NET and ADO.NET working with a DataGrid control. MY datagrid table has both a date_sent and a date_ans field. When I Insert a record in my SQL...
7
28730
by: Cindy H | last post by:
Hi I'm having a problem getting the insert statement correct for an Access table I'm using. The Access table uses an autonumber for the primary key. I have tried this: INSERT INTO Tournaments...
1
1232
by: kitskaps | last post by:
Hey, I am working on a project in VB.NET.right now i am stuckupw ith a problem, i have different pages with different forms on it , but all the entries are supposed to be entered into a single...
1
21023
by: filip1150 | last post by:
I'm trying to find if there is any performance diference between explicitly using a sequence in the insert statement to generate values for a column and doing this in an insert trigger. I...
1
1042
by: arial | last post by:
I have two problem. 1) My insert statement here is not working. It is not inserting value into the database. I am not getting any error message but I can not figured out why it is not...
3
4225
by: chico | last post by:
Hi, I'm using Visual Studio 2005, C#.net and Oracle. I cant get this insert statement to work, it raises the following exception: A first chance exception of type...
0
7234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7412
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.