Jag har ett sida där jag postar från ett formulär till detta script:
<%@ Language = "VBScript"%>
<%
'Declare all local variables
dim conn
dim rs
dim strconn
dim strsql
strsql = ""
'set connection string to local variable
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("\cgi-bin\gig.mdb")
'build the sql statement based on the input from the form
strSQL = "INSERT INTO Gig(Datum, Ort, Hak, Band, Url, Av, Inform)"
strSQL = strSQL & " SELECT "
strSQL = strSQL & "'" & request("Datum") & "' as Datum,"
strSQL = strSQL & "'" & request("Ort") & "' as Ort,"
strSQL = strSQL & "'" & request("Hak") & "' as Hak,"
strSQL = strSQL & "'" & request("Band") & "' as Band,"
strSQL = strSQL & "'" & request("Url") & "' as Url,"
strSQL = strSQL & "'" & request("Av") & "' as Av,"
strSQL = strSQL & "'" & request("Inform") & "' as Inform"
'Set connection object
set conn = server.createobject("adodb.connection")
conn.open strconn
'Use the execute method of the connection object the insert the record
conn.execute(strSQL)
conn.close
set conn = nothing
%>
Men om jag försöker att posta tecknet " ' " så får jag felmeddelandet:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access 97 Driver] Syntax error in string in query expression '' '' as Inform'.
/gig/add2.asp, line 30
Hur kommer jag runt detta problem och varför blir det så ? Jag har testat med en massa andra tecken såsom: !"#¤%& och alla funkar utom : " ' "
------------------
Explorer in a further region of experience.
<A HREF="http://www.lifestyleshop.nu" TARGET=_blank>www.LifeStyleShop.nu</A>