sven2
05-07-2009, 10:21 AM
Hello,
this is something I can't get right ...
When I use a string to put a value into a table like
strSQL = " INSERT INTO ... '" & me.txtstring & "' then there is no problem exept when there is a ' sign in the string.
In access you can solve this problem like
""" & me.txtstring & """ but this doesn't work in combination with SQL ...
What is the right syntax in SQL so I can use the ' sign?
This is the string that I want to change:
strSQL = " INSERT INTO Item_Stam (Itemomschrijving, Competentie, Soortopleiding, Aspect, Geldigheidsperiode ) "
strSQL = strSQL & " VALUES ('" & [Forms]![FrmCompetentieItemToevoegen]![txtItemomschrijving] & "', "
strSQL = strSQL & "'" & [Forms]![FrmCompetentieItemToevoegen]![txtCompetentie] & "', "
strSQL = strSQL & "'" & [Forms]![FrmCompetentieItemToevoegen]![txtSoortopleiding] & "', "
strSQL = strSQL & "'" & [Forms]![FrmCompetentieItemToevoegen]![txtAspect] & "', "
strSQL = strSQL & "'" & [Forms]![FrmCompetentieItemToevoegen]![txtGeldigheidsperiode] & "' ) "
CurrentProject.Connection.Execute (strSQL)
Thanks in advance,
Sven.
this is something I can't get right ...
When I use a string to put a value into a table like
strSQL = " INSERT INTO ... '" & me.txtstring & "' then there is no problem exept when there is a ' sign in the string.
In access you can solve this problem like
""" & me.txtstring & """ but this doesn't work in combination with SQL ...
What is the right syntax in SQL so I can use the ' sign?
This is the string that I want to change:
strSQL = " INSERT INTO Item_Stam (Itemomschrijving, Competentie, Soortopleiding, Aspect, Geldigheidsperiode ) "
strSQL = strSQL & " VALUES ('" & [Forms]![FrmCompetentieItemToevoegen]![txtItemomschrijving] & "', "
strSQL = strSQL & "'" & [Forms]![FrmCompetentieItemToevoegen]![txtCompetentie] & "', "
strSQL = strSQL & "'" & [Forms]![FrmCompetentieItemToevoegen]![txtSoortopleiding] & "', "
strSQL = strSQL & "'" & [Forms]![FrmCompetentieItemToevoegen]![txtAspect] & "', "
strSQL = strSQL & "'" & [Forms]![FrmCompetentieItemToevoegen]![txtGeldigheidsperiode] & "' ) "
CurrentProject.Connection.Execute (strSQL)
Thanks in advance,
Sven.