Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: help with insert into statement

Geek News

help with insert into statement
short 11/12/2008 5:15:03 PM
Can someone help me with what's wrong with this insert into statement?

SoftwareID = "SELECT Software.[ID] FROM Software where Software.[Name] = '"
+ cmbSoftware.Value + " AND ServerID = '" + ServerID = "';"
(this comes from a combo box)

nodeID = ID

Dim sql As String
sql = "INSERT INTO Node_Software ( [NodeID] [SoftwareID])
Values (""" & nodeID & SoftwareID & """)"
MsgBox sql
DoCmd.RunSQL sql


Re: help with insert into statement
Stefan Hoffmann <ste5an[ at ]ste5an.de> 11/12/2008 5:25:26 PM
hi Shorty,

short wrote:
[Quoted Text]
> Dim sql As String
> sql = "INSERT INTO Node_Software ( [NodeID] [SoftwareID])
> Values (""" & nodeID & SoftwareID & """)"
> MsgBox sql
> DoCmd.RunSQL sql
Missing commas:

"INSERT INTO Node_Software([NodeID], [SoftwareID]) " & _
"VALUES ('" & nodeID & "', '" & SoftwareID & "')"


mfG
--> stefan <--
Re: help with insert into statement
short 11/12/2008 5:47:02 PM
thanks so much!

"Stefan Hoffmann" wrote:

[Quoted Text]
> hi Shorty,
>
> short wrote:
> > Dim sql As String
> > sql = "INSERT INTO Node_Software ( [NodeID] [SoftwareID])
> > Values (""" & nodeID & SoftwareID & """)"
> > MsgBox sql
> > DoCmd.RunSQL sql
> Missing commas:
>
> "INSERT INTO Node_Software([NodeID], [SoftwareID]) " & _
> "VALUES ('" & nodeID & "', '" & SoftwareID & "')"
>
>
> mfG
> --> stefan <--
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net