|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
From a browser insert or update data to a SQL Server 2005 table?am pursuing an answer to my question and how dumb I feel. This is an HTML text box and a submit button. I want to enter data into the textbox and insert that data into a SQL Server 2005 Enterprise Edition table. <form method="POST"> <input type="text" name="T1" size="20"> <input type="submit" value="Submit" name="B1"> </form> I just finished weeding through tons of documentation and I’m no further ahead. Also, I don’t want to use Visual Studio, I’m just now trying to weed out old vb6 stuff. So my alternatives are: - I have to route data through IIS? - I don’t have to route through IIS. In a google search some guy said I could connect directly to SQL Server with some web service stuff. - Sticking with the family my only alternatives are HTTP/SOAP or VBScript? - My best alternative is HTTP/SOAP? I don’t want to do anything fancy, I just want to pass parameters and values into SQL Server as efficiently and modern as possible. To me this is low level stuff and I’m more of a process guy. If anybody could give me a simple cut and paste example where all I do is replace my username and password then I’ll buy the beers. Best Regards, Mark PS – From VB6 this is what I’m doing now. When submitting http://mydomain/default.asp/c=XXX Called from a webclass. Public Sub XXX() Dim locmd As New adodb.Command Dim lberror As Boolean Dim loresultsets As Collection Dim loresults As New adodb.Recordset Dim cmhe_errorhandler As New HE_ERRORHandler Call mowebmanager.CaptureFormFields locmd.CommandType = adCmdStoredProc locmd.CommandText = XXX locmd.Parameters.Append locmd.CreateParameter("Result", adInteger, adParamReturnValue) locmd.Parameters.Append locmd.CreateParameter("xxx", adWChar, adParamInput, 64, mowebmanager.Variable("xxx")) locmd.Parameters.Append locmd.CreateParameter("xxx", adVarWChar, adParamInput, 512, mowebmanager.WebApplication.xxx) Set loresultsets = mowebmanager.ExecuteCmd(msmodule, locmd, lberror, "Result") If Not lberror Then If loresultsets.Count > 0 Then Set loresults = loresultsets.Item(1) Set mowebmanager.QueryResults("lsStoredProcedure") = loresultsets.Item(1) moresponse.Write (loresults.Fields("Content")) Else Call cmhe_errorhandler.doinitialize(mowebmanager, mowebitem, moserver, moapplication, mosession, morequest, moresponse) Call cmhe_errorhandler.HE_ERRORHandler(strstoredprocedure) End If Else Call cmhe_errorhandler.doinitialize(mowebmanager, mowebitem, moserver, moapplication, mosession, morequest, moresponse) Call cmhe_errorhandler.HE_ERRORHandler(strstoredprocedure) End If End Sub Hi,
The IIS route seems to be the easiest. Just use a few lines of ASP to get this done. I know you said that you would prefer avoid using IIS, Visual Studio etc. But these seem to be the easiest if all you intend is to enter values into database from a HTML page. If you have written such code in VB, then picking up a little of ASP for achieving what you desire would hardly be any effort! Good luck and sorry that I couldn't be of much help. Regards, Karthik Show quote "Mark In Atlanta" wrote: > Sorry I included this code but I needed to demonstrate how clear and simple I > am pursuing an answer to my question and how dumb I feel. > > This is an HTML text box and a submit button. I want to enter data into the > textbox and insert that data into a SQL Server 2005 Enterprise Edition table. > > <form method="POST"> > <input type="text" name="T1" size="20"> > <input type="submit" value="Submit" name="B1"> > </form> > > I just finished weeding through tons of documentation and I’m no further > ahead. > > Also, I don’t want to use Visual Studio, I’m just now trying to weed out old > vb6 stuff. > > So my alternatives are: > > - I have to route data through IIS? > - I don’t have to route through IIS. In a google search some guy said I > could connect directly to SQL Server with some web service stuff. > - Sticking with the family my only alternatives are HTTP/SOAP or VBScript? > - My best alternative is HTTP/SOAP? > > I don’t want to do anything fancy, I just want to pass parameters and values > into SQL Server as efficiently and modern as possible. To me this is low > level stuff and I’m more of a process guy. > > If anybody could give me a simple cut and paste example where all I do is > replace my username and password then I’ll buy the beers. > > Best Regards, > Mark > > PS – From VB6 this is what I’m doing now. > > When submitting http://mydomain/default.asp/c=XXX > > Called from a webclass. > > Public Sub XXX() > > Dim locmd As New adodb.Command > Dim lberror As Boolean > Dim loresultsets As Collection > Dim loresults As New adodb.Recordset > Dim cmhe_errorhandler As New HE_ERRORHandler > > Call mowebmanager.CaptureFormFields > > locmd.CommandType = adCmdStoredProc > locmd.CommandText = XXX > locmd.Parameters.Append locmd.CreateParameter("Result", adInteger, > adParamReturnValue) > locmd.Parameters.Append locmd.CreateParameter("xxx", adWChar, > adParamInput, 64, mowebmanager.Variable("xxx")) > locmd.Parameters.Append locmd.CreateParameter("xxx", adVarWChar, > adParamInput, 512, mowebmanager.WebApplication.xxx) > > Set loresultsets = mowebmanager.ExecuteCmd(msmodule, locmd, lberror, > "Result") > > If Not lberror Then > > If loresultsets.Count > 0 Then > Set loresults = loresultsets.Item(1) > Set mowebmanager.QueryResults("lsStoredProcedure") = > loresultsets.Item(1) > moresponse.Write (loresults.Fields("Content")) > Else > Call cmhe_errorhandler.doinitialize(mowebmanager, mowebitem, > moserver, moapplication, mosession, morequest, moresponse) > Call cmhe_errorhandler.HE_ERRORHandler(strstoredprocedure) > End If > > Else > Call cmhe_errorhandler.doinitialize(mowebmanager, mowebitem, > moserver, moapplication, mosession, morequest, moresponse) > Call cmhe_errorhandler.HE_ERRORHandler(strstoredprocedure) > End If > > End Sub > |
|||||||||||||||||||||||