type mismatch problem

Results 1 to 2 of 2

Thread: type mismatch problem

  1. #1
    Join Date
    Dec 1969

    Default type mismatch problem

    Can someone help me please............<BR><BR>I keep getting a type mismatch error when I try to add a record to my database.<BR><BR>The datatypes of these fields are Date/Time.<BR><BR>This is the code I am using:<BR><BR>Dim MyConn, RS, strEvent_Name, strLocation, strCity, strState, strZip_Code, strDescription, strStart_Date, strEnd_Date, strTime, strPhone, strWebsite, strEmail, strevent_image<BR><BR><BR>strEvent_Name = Request.Form("txtEvent_Name")<BR>strLocation = Request.Form("txtLocation")<BR>strCity = Request.Form("txtCity")<BR>strState = Request.Form("txtState")<BR>strZip_Code = Request.Form("txtZip_Code")<BR>strDescription = Request.Form("txtDescription")<BR>strStart_Date = Request.Form("txtStart_Date")<BR>strEnd_Date = Request.Form("txtEnd_Date")<BR>strTime = Request.Form("txtTime")<BR>strPhone = Request.Form("txtPhone")<BR>strWebsite = Request.Form("txtWebsite")<BR>strEmail = Request.Form("txtEmail")<BR>strevent_image = Request.Form("txtevent_image")<BR><BR>Set MyConn=Server.CreateObject("ADODB.Connection")<BR> Set RS=Server.CreateObject("ADODB.RecordSet")<BR><BR>M yConn.Open "Businesses"<BR><BR>RS.Open "Select * From Events", MyConn, adOpenDynamic, adLockPessimistic, adCMDText<BR><BR><BR>RS.AddNew<BR>RS("Event_Name") = strEvent_Name<BR>RS("Location")= strLocation<BR>RS("City")= strCity<BR>RS("State")= strState<BR>RS("Zip_Code")= strZip_Code<BR>RS("Description")= strDescription<BR>RS("Start_Date")= strStart_Date<BR>RS("End_Date")= strEnd_Date<BR>RS("Time")= strTime<BR>RS("Phone")= strPhone<BR>RS("Website")= strWebsite<BR>RS("Email")= strEmail<BR>RS("event_image")= strevent_image<BR>RS.Update<BR><BR>I keep getting an error at the RS("Start_Date") line.<BR><BR>I know this code needs some fixing because of the date.<BR><BR>How do I change the code so it will work??<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default Don't post multiple times

    that too within a span of 2 minutes.

Posting Permissions

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