codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  What is wrong with this ASP codes? It don`t seem to work???  CBSON at 15:35 on Monday, October 25, 2004
 

<%
' Declaring variables
Dim name, nric, contact, address, movie, time, date, month, data_source, con, sql_insert

' A Function to check if some field entered by user is empty
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function

' Receiving values from Form
LastName = ChkString(Request.Form(name))
Nric = ChkString(Request.Form(nric))
Contact = ChkString(Request.Form(contact))
Address = ChkString(Request.Form(address))
Movie = ChkString(Request.Form([movie]))
[Time] = ChkString(Request.Form("time"))
[Date] = ChkString(Request.Form(date))
[Month] = ChkString(Request.Form(month))

data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("form.mdb")
sql_insert = "insert into movie (name, nric, contact, address, time, date, month) values ('" & name & "', '" & nric & "', '" & contact & "', '" & address & "', '" & movie & "', '" & time & "', '" & [date] & "', '" & month & "')"

' Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute sql_insert
' Done. Close the connection
con.Close
Set con = Nothing
Response.Write "All records were successfully entered into the database."
%>


it keeps givin me syntax error.
Can anyone help on this?








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  login system with asp.net
•  Re: Help: Trouble with z-Index and SELECT lists
•  What is wrong with this ASP codes? It don`t seem to work???
•  Need help with ListBox control
•  Re: Good Javascript/DHTML Reference
•  Re: scrolling table
•  Re: simulation of road traffic
•  ASP.NET calendar help
•  Re: Hosting Plan or Scam?


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2004