Hi
I'm trying to insert date from a form input to SQL..
This is how i wrote the code
txtDateValue = Request.Form("datevalue"
sql = "INSERT INTO tbTopic(Topic,TopicDesc,TopicDetail,[Date],Venue,[Time],MaxAllowed) values('?','?','?',""'#" & txtDateValue & "#'"",'?','?','?')"
sql = Replace(sql, "?", txtTopic, 1, 1)
sql = Replace(sql, "?", txtTopicBrief, 1, 1)
sql = Replace(sql, "?", txtTopicDetail, 1, 1)
sql = Replace(sql, "?", txtVenue, 1, 1)
sql = Replace(sql, "?", txtTimeValue, 1, 1)
sql = Replace(sql, "?", txtMaxAllowed, 1, 1)
This is error generated from the above code
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]The name ''#10/03/2003#'' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
Any idea where I may be going wrong?
Your help is greatly appreciated!
I'm trying to insert date from a form input to SQL..
This is how i wrote the code
txtDateValue = Request.Form("datevalue"
sql = "INSERT INTO tbTopic(Topic,TopicDesc,TopicDetail,[Date],Venue,[Time],MaxAllowed) values('?','?','?',""'#" & txtDateValue & "#'"",'?','?','?')"
sql = Replace(sql, "?", txtTopic, 1, 1)
sql = Replace(sql, "?", txtTopicBrief, 1, 1)
sql = Replace(sql, "?", txtTopicDetail, 1, 1)
sql = Replace(sql, "?", txtVenue, 1, 1)
sql = Replace(sql, "?", txtTimeValue, 1, 1)
sql = Replace(sql, "?", txtMaxAllowed, 1, 1)
This is error generated from the above code
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]The name ''#10/03/2003#'' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
Any idea where I may be going wrong?
Your help is greatly appreciated!