Hey Everyone,
Need help with this database connection in ASP. I am getting the following error on the line that is in bold below: An exception of type 'Microsoft OLE DB Provider for ODBC Drivers:[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'calendarinfotable'.'was not handled.
My SQL database table's name is calendarinfotable and my recorded is not being added. I can successfully run the SQL Statement in SQL and I can see from writing it to the screen that all the variables are being passed correctly from my form.
This is the first time that I have connected to a database this way so I am probably doing something wrong there. Can someone please help?
Thanks tmishue
Set recordSet=CCSCal.Execute(sqlStatement)
Need help with this database connection in ASP. I am getting the following error on the line that is in bold below: An exception of type 'Microsoft OLE DB Provider for ODBC Drivers:[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'calendarinfotable'.'was not handled.
My SQL database table's name is calendarinfotable and my recorded is not being added. I can successfully run the SQL Statement in SQL and I can see from writing it to the screen that all the variables are being passed correctly from my form.
This is the first time that I have connected to a database this way so I am probably doing something wrong there. Can someone please help?
Thanks tmishue
Code:
<BODY>
<%
internala = Request.Form("internalh")
froma = Request.Form("fromh")
categorya = Request.Form("categoryh")
locationa = Request.Form("locationh")
rooma = Request.Form("roomh")'
subjecta = Request.Form("subjecth")
personala = Request.Form("personalh")
toemaila = Request.Form("toemailh")
startdatea = Request.Form("startdateh")
starttimea = Request.Form("starttimeh")
enddatea = Request.Form("enddateh")
endtimea = Request.Form("endtimeh")
Set CCSCal=Server.CreateObject("ADODB.Connection")
CCSCal.ConnectionTimeout=40
CCSCal.Open "DSN=CCSCalendarSQL"
sqlStatement = "INSERT INTO calendarinfotable(DepartmentSchool, Category, Subject, Room, Location, StartDate, StartTime, EndDate, EndTime, Intranet, Toemail, Personal) VALUES ('"& cstr(froma) & "','"& cstr(categorya) &"', '"& cstr(subjecta) &"', '"& cstr(rooma) &"', '"& cstr(locationa) &"', '"& cstr(startdatea) &"', '"& cstr(starttimea) &"', '"& enddatea &"', '"& cstr(endtimea) &"', '"& cstr(internala) &"', '"& cstr(toemaila) &"', '"& cstr(personala) &"')"
Response.Write(sqlStatement)
Code:
CCSCal.Close
Set CCSCal=Nothing
Response.Write("Appointment Added!")
%>