Connecting Tech Pros Worldwide Help | Site Map

SQL Insert question

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 05:17 PM
Daniel Tan
Guest
 
Posts: n/a
Default 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

  #2  
Old November 12th, 2005, 05:17 PM
KeejToe
Guest
 
Posts: n/a
Default Re: SQL Insert question

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" <danieltan@time.net.my> wrote in message
news:6a6a9040.0312270548.588ebe9@posting.google.co m...[color=blue]
> 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[/color]


  #3  
Old November 12th, 2005, 05:18 PM
Daniel Tan
Guest
 
Posts: n/a
Default Re: SQL Insert question

Hi, still got syntax error, missing operator. "[job_order]='xxx'"

Rgds,
Daniel

"KeejToe" <bitplace@hotmail.com> wrote in message news:<cigHb.99028$Tf7.4397168@phobos.telenet-ops.be>...[color=blue]
> 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" <danieltan@time.net.my> wrote in message
> news:6a6a9040.0312270548.588ebe9@posting.google.co m...[color=green]
> > 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[/color][/color]
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.