I have an admin system which allows users to add news items etc. But for some reason when the code comes to execute an SQL statement which will add a news item, it just errors without specifying why.
The bizarre thing is when I've retireved data from the database, such as when the user logs in, it works fine. Obviously something to do with adding records.
Any ideas? Here is an example of such code...I removed unrelated code...note: the sql statements used are correct...so it's the actual execution.
strConn = DefineConnectionString("")
Set adoCn = Server.CreateObject("ADODB.Connection")
adoCn.Open strConn
If Request.QueryString("action") = "save" Then
strSQL = "INSERT INTO tblDocument" ...and so forth
adoCn.Execute strSQL
Response.Redirect "admin_MgrDocs.asp"
End if
adoCn.Close
Set adoCn = Nothing
And yet this code works fines...
strCn = DefineConnectionString("")
Set adoCn = Server.CreateObject("ADODB.Connection")
adoCn.Open strCn
SQL = "SELECT Passcode, FullName"...and so forth
Set objRS = adoCn.Execute(SQL)
' DO STUFF
' Garbage collection
Set objRS = Nothing
Set adoCn = Nothing