Re: DB entry doesn't work
Quote:
Originally posted by -=R0ckAw4Y=-
hi
can somebody tell me what wrong here? because it tells me that there is an error on line 39, and line 39 is the the last line posted here (adoCon.Execute (strSQL)
it also tells that there is a synthax error in the INSERT INTO part
Code:
Set adoCon = Server.CreateObject("ADODB.Connection")
Set rsAddNewRecord = Server.CreateObject("ADODB.Recordset")
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("../dbroot/Names.mdb")
adoCon.Open strCon
strSQL = "INSERT INTO NameDB (Name, Language, Quality, Rating)"
strSQL = strSQL & " VALUES "
strSQL = strSQL & "('" & Name
strSQL = strSQL & "', '" & Language
strSQL = strSQL & "', '" & Quality
strSQL = strSQL & "', " & Rating
strSQL = strSQL & "' );"
adoCon.Execute (strSQL)
Name, Language, Quality, Rating are defined someplace upper in the code, there extracted from a form and Rating is a number in the form and coverted using this
Code:
Rating = "<img src=images/rating" & Request.Form("rating") & ".gif>"
thx 4 help!
-=R0ckAw4Y=-
Hi,
There is an extra single quote at the end [ "'")"] also wrap a brace around the field name [e.g. [Name] instaead of Name], that might cause problem as its a keyword.
Hope this helps.
Danial