Very bizarre database behavior! Need a genius!

Results 1 to 4 of 4

Thread: Very bizarre database behavior! Need a genius!

  1. #1
    Kristin Hedge Guest

    Default Very bizarre database behavior! Need a genius!

    Below is a code snippet from a web form that is supposed to submit to a SQL Server DB. The strangest thing is happening. If I submit just a couple of the fields, they appear in the table. If I fill out the whole form, the values in the table all appear as &#060;NULL&#062;. Is this a cursor problem/ADO problem or a SQL Server problem??? I have troubleshot for permissions, connection scripts, I am running out of time! Can someone help, please?<BR>&#060;% <BR>Dim Conn <BR>Dim oRSi<BR>set Conn = Server.CreateObject("ADODB.connection")<BR>Conn.Op en "ibp", "sa", ""<BR>set oRSi = Server.CreateObject("ADODB.Recordset")<BR>oRSi.Ope n "SELECT * FROM Provisioning", Conn, 3,3<BR>oRSi.AddNew <BR>oRSi("Name") = Request.Form("Name")<BR>oRSi("EmpID") = Request.Form("EmpID")<BR>oRSi("Supervisor") = Request.Form("Supervisor")<BR>oRSi("Supervisor_Pho ne") = Request.Form("Supervisor_Phone")<BR>oRSi("Supervis or_Email") = Request.Form("Supervisor_Email")<BR>oRSi("Call_Cen ter") = Request.Form("Call_Center")<BR>oRSi("Business_Issu e") = Request.Form("Business_Issue")<BR>oRSi("Type_Issue ") = Request.Form("Type_Issue")<BR>oRSi("Description_Is sue") = Request.Form("Description_Issue")<BR>oRSi("Descrip tion_ShouldHappen") = Request.Form("Description_ShouldHappen")<BR>oRSi(" Description_Current") = Request.Form("Description_Current")<BR>oRSi("Descr iption_NumberofTimes") = Request.Form("Description_NumberofTimes")<BR>oRSi( "CustomerImpact") = Request.Form("CustomerImpact")<BR>oRSi("BusinessIm pact") = Request.Form("BusinessImpact")<BR>oRSi("Changeabil ity") = Request.Form("Changeability")<BR>oRSi("What_they_t hink") = Request.Form("What_they_think")<BR>oRSi.Update<BR> oRSi.Close<BR>Conn.Close<BR>set oRSi=Nothing<BR>set Conn=Nothing<BR>%&#062;<BR>

  2. #2
    Markkk Guest

    Default RE: Very bizarre database behavior! Need a genius!

    Keep in mind that whenever you use Request.Form("FormFieldName") the data subtype returned is a String Subtype. If all the data fields in your database are String or Text types, then you probably will never have a problem.<BR><BR>However, if some database field names are Numeric Subtype(Integer, Long, Single, or Double) or Date Subtype (date or time) or Boolean Subtype (Yes or No), then you may have to convert the String variant to the proper subtype to match that of your database field.<BR><BR>e.g. <BR>intEmpID = CInt(Request.Form("EmpID")<BR>oRSi("EmpID") = intEmpID<BR><BR>In this example, the database field name (EmpID) is assumed to be a Numeric Integer field type. The variant established by the Request.Form("EmpID") is a String subtype. You may have to convert the String Subtype to an Numeric-Integer Subtype via the CInt() function (convert variant to Integer subtype).<BR><BR>Look at the data types for each field in your database as make sure that you use the proper data subtype.<BR><BR>I recommend that you enter a record at a time, adding an additional field entry each try. Examine the field that causes the fault.<BR><BR>I hope this helps.

  3. #3
    Join Date
    Dec 1969

    Default RE: Very bizarre database behavior! Need a genius!

    Try out this<BR> "tablename",conn,2,2<BR>hope it helps<BR>let me know<BR>

  4. #4
    Join Date
    Dec 1969

    Default RE: Very bizarre database behavior! Need a genius!

    Mark. You&#039re feedback was helpful in my troubleshooting. The EmpID field was returning &#060;NULL&#062; because of the fact it was not converted to an integer that one works now. I took your advice and started adding fields one by one. They worked until I got to field #7 and then I started getting the error "Multiple-step OLE DB operation generated errors (80040e21). Any ideas? Thanks again.<BR>Kristin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts