Okay, I tried that and now I get
Security Exception
Description: The
application attempted to perform an operation not allowed by the
security policy. To grant this application the required permission
please contact your system administrator or change the application's
trust level in the configuration file.
Exception Details: System.Security.SecurityException:
Request for the permission of type
'System.Security.Permissions.SecurityPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.
Source Error:
Line 122:'database connection Line 123: Line 124:adoCon = Server.CreateObject("OLEDB.Connection") Line 125:strConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=solid.db.xxx.hostedresource.com; PORT=3306; DATABASE=xxx; USER=solid; PASSWORD='xxx'; OPTION=0;" Line 126:adoCon.Open (strConnection)
|
Source File: d:\hosting\willseye\donations\give\submit.aspx Line: 124
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Web.HttpServerUtility.CreateObject(String progID) +45 ASP.donations_give_submit_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\hosting\willseye\donations\give\submit.aspx:124 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 System.Web.UI.Page.Render(HtmlTextWriter writer) +29 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242 System.Web.UI.Page.ProcessRequest() +80 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 System.Web.UI.Page.ProcessRequest(HttpContext context) +49 ASP.donations_give_submit_aspx.ProcessRequest(HttpContext context) +37 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
|
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3053
My code is now:
'database connection
adoCon = Server.CreateObject("OLEDB.Connection")
strConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=solid.db.xxx.hostedresource.com; PORT=3306; DATABASE=solid; USER=xxx; PASSWORD='xxx'; OPTION=0;"
adoCon.Open (strConnection)
adoCon.execute(strSQL)
'close database connections
adoCon.Close
adoCon = Nothing