473,654 Members | 3,103 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Insert question

I got a syntax error in SQL insert into statement , hope someone can
help me .Thanks.

job_search = "[job_order]='" & Me.Jobno & "' "
sqlstr = "INSERT INTO Custorder (job_order) " & _
"values " & (job_search) & ";"

Regards,
Daniel
Nov 12 '05 #1
2 1262
The right syntax should be something like:
INSERT INTO Custorder (job_order) VALUES (123)
or, in case of alfanumeric values:
INSERT INTO Custorder (job_order) VALUES ('abc')

so your code should be something like:

sqlstr = "INSERT INTO Custorder (job_order) VALUES (" & Jobno & ");"
or
sqlstr = "INSERT INTO Custorder (job_order) VALUES ('" & Jobno & "');"

hope this helps....

"Daniel Tan" <da*******@time .net.my> wrote in message
news:6a******** *************** **@posting.goog le.com...
I got a syntax error in SQL insert into statement , hope someone can
help me .Thanks.

job_search = "[job_order]='" & Me.Jobno & "' "
sqlstr = "INSERT INTO Custorder (job_order) " & _
"values " & (job_search) & ";"

Regards,
Daniel

Nov 12 '05 #2
Hi, still got syntax error, missing operator. "[job_order]='xxx'"

Rgds,
Daniel

"KeejToe" <bi******@hotma il.com> wrote in message news:<ci******* **************@ phobos.telenet-ops.be>...
The right syntax should be something like:
INSERT INTO Custorder (job_order) VALUES (123)
or, in case of alfanumeric values:
INSERT INTO Custorder (job_order) VALUES ('abc')

so your code should be something like:

sqlstr = "INSERT INTO Custorder (job_order) VALUES (" & Jobno & ");"
or
sqlstr = "INSERT INTO Custorder (job_order) VALUES ('" & Jobno & "');"

hope this helps....

"Daniel Tan" <da*******@time .net.my> wrote in message
news:6a******** *************** **@posting.goog le.com...
I got a syntax error in SQL insert into statement , hope someone can
help me .Thanks.

job_search = "[job_order]='" & Me.Jobno & "' "
sqlstr = "INSERT INTO Custorder (job_order) " & _
"values " & (job_search) & ";"

Regards,
Daniel

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3093
by: Bob Bedford | last post by:
I've a textarea and would like to save the content in a mysql table each time a user click on a form. How can I do for avoiding error when the user put a " or a ' in the message, or any other character that may cause problems. My query is: "insert into questions(UserID,Question) values (".$HTTP_POST_VARS.",'".$HTTP_POST_VARS."')"
8
5514
by: Sans Spam | last post by:
Greetings! I have a table that contains all of the function permissions within a given application. These functions are different sections of a site and each has its own permissions (READ, WRITE, UPDATE, DELETE) which are controlled by a web frontend and the table records are manipulated to control the permissions. Example: The Press Release section record would look like this: Username: John Doe Function Name: Press Release
4
6921
by: soni29 | last post by:
hi, i have a small question regarding sql, there are two tables that i need to work with on this, one has fields like: Table1: (id, name, street, city, zip, phone, fax, etc...) about 20 more columns Table2: name what i need help with is that table2 contains about 200 distinct names that i need to insert into table1, i'm using sql server, is there a
5
4710
by: TThai | last post by:
HI, I'm trying to insert records to a table using bcp command. The problem is the input file to the bcp is a text file that looks like this: Text file data: 1234 abc def ghi jkl mno Expected result: column1 1234
11
7507
by: Jean-Christian Imbeault | last post by:
I have a table with a primary field and a few other fields. What is the fastest way to do an insert into that table assuming that sometimes I might try to insert a record with a duplicate primary key and want that to fail? I know that if I try a plain insert this will work, but in the case where I am trying to insert a duplicate key, the insert fails (as it should) and an error is logged. I could first do a check to see if there is...
25
11093
by: Andreas Fromm | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Im building an user database with many tables keeping the data for the Address, Phone numbers, etc which are referenced by a table where I keep the single users. My question is, how do I get the "Id"-value of a newly inserted address to store it in the referencing user table:
16
3867
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the table, or perhaps bytes, being updated where the engine just decides, screw it, i'll just make a new one. surfed this group and google, but couldn't find anything. the context: we have some java folk who like to parametize/
1
3030
by: javedna | last post by:
Can PHP help with the following as I have tried in the MYSQL Forums and cant get any help Thanks Nabz ---------------------------------------- Hi I am developing a PHP MYSQL questionnaire tool. The problem I am having is that of inserting all the answers into the table. The questionnaire is Dynamic so the number of questions can vary. I have a variable that counts them so at the moment there is 75 questions.
10
10497
by: Aditya | last post by:
Hi All, I would like to know how it is possible to insert a node in a linked list without using a temp_pointer. If the element is the first element then there is no problem but if it is in between then what is the best solution.
24
7121
by: Henry J. | last post by:
My app needs to insert thousand value rows into a mostly empty table (data are read from a file). I can either use inserts, or use merge. The advantage of using merge is that in the few cases where the table is not empty, it can take care of the updating part, which makes the app cleaner. However, my concern is the merge state would slow dowm the insertion of new data, since in most cases the table is empty. So my questions (before I...
0
8372
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8285
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8475
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5621
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1592
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.